| 334 | } |
| 335 | |
| 336 | String 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 | |
| 353 | void InfluxdbCommonWriter::SendMetric(const Checkable::Ptr& checkable, const Dictionary::Ptr& tmpl, |
| 354 | const String& label, const Dictionary::Ptr& fields, double ts) |