* 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. */
| 459 | * @return Escaped string. Arrays are joined with dots. |
| 460 | */ |
| 461 | Value 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' |