MCPcopy Create free account
hub / github.com/Icinga/icinga2 / EscapeValue

Method EscapeValue

lib/perfdata/influxdbcommonwriter.cpp:336–351  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

334}
335
336String InfluxdbCommonWriter::EscapeValue(const Value& value)
337{
338 if (value.IsObjectType<InfluxdbInteger>()) {
339 std::ostringstream os;
340 os << static_cast<InfluxdbInteger::Ptr>(value)->GetValue() << "i";
341 return os.str();
342 }
343
344 if (value.IsBoolean())
345 return value ? "true" : "false";
346
347 if (value.IsString())
348 return "\"" + EscapeKeyOrTagValue(value) + "\"";
349
350 return value;
351}
352
353void InfluxdbCommonWriter::SendMetric(const Checkable::Ptr& checkable, const Dictionary::Ptr& tmpl,
354 const String& label, const Dictionary::Ptr& fields, double ts)

Callers

nothing calls this directly

Calls 3

IsBooleanMethod · 0.80
IsStringMethod · 0.80
GetValueMethod · 0.45

Tested by

no test coverage detected