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

Method EscapeMacroMetric

lib/perfdata/graphitewriter.cpp:461–475  ·  view source on GitHub ↗

* Escape macro metrics found via host/service name templates * * @param value Array or string with macro metric names * @return Escaped string. Arrays are joined with dots. */

Source from the content-addressed store, hash-verified

459 * @return Escaped string. Arrays are joined with dots.
460 */
461Value GraphiteWriter::EscapeMacroMetric(const Value& value)
462{
463 if (value.IsObjectType<Array>()) {
464 Array::Ptr arr = value;
465 ArrayData result;
466
467 ObjectLock olock(arr);
468 for (const Value& arg : arr) {
469 result.push_back(EscapeMetric(arg));
470 }
471
472 return Utility::Join(new Array(std::move(result)), '.');
473 } else
474 return EscapeMetric(value);
475}
476
477/**
478 * Validate the configuration setting 'host_name_template'

Callers

nothing calls this directly

Calls 1

push_backMethod · 0.80

Tested by

no test coverage detected