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

Method EscapeMetric

lib/perfdata/graphitewriter.cpp:421–432  ·  view source on GitHub ↗

* Escape metric tree elements * * Dots are not allowed, e.g. in host names * * @param str Metric part name * @return Escape string */

Source from the content-addressed store, hash-verified

419 * @return Escape string
420 */
421String GraphiteWriter::EscapeMetric(const String& str)
422{
423 String result = str;
424
425 //don't allow '.' in metric prefixes
426 boost::replace_all(result, " ", "_");
427 boost::replace_all(result, ".", "_");
428 boost::replace_all(result, "\\", "_");
429 boost::replace_all(result, "/", "_");
430
431 return result;
432}
433
434/**
435 * Escape metric label

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected