MCPcopy Create free account
hub / github.com/apple/foundationdb / getNumericValue

Function getNumericValue

flow/Trace.cpp:1588–1608  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1586
1587template <class T>
1588T getNumericValue(TraceEventFields const& fields, std::string key, bool permissive) {
1589 std::string field = fields.getValue(key);
1590
1591 try {
1592 T value;
1593 parseNumericValue(field, value, permissive);
1594 return value;
1595 } catch (Error& e) {
1596 std::string type;
1597
1598 TraceEvent ev(SevWarn, "ErrorParsingNumericTraceEventField");
1599 ev.error(e);
1600 if (fields.tryGetValue("Type", type)) {
1601 ev.detail("Event", type);
1602 }
1603 ev.detail("FieldName", key);
1604 ev.detail("FieldValue", field);
1605
1606 throw;
1607 }
1608}
1609} // namespace
1610
1611int TraceEventFields::getInt(std::string key, bool permissive) const {

Callers

nothing calls this directly

Calls 5

parseNumericValueFunction · 0.85
tryGetValueMethod · 0.80
detailMethod · 0.80
getValueMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected