1 package com.griddynamics.jagger.engine.e1.services;
3 import com.griddynamics.jagger.coordinator.NodeContext;
4 import com.griddynamics.jagger.engine.e1.collector.MetricDescription;
5 import com.griddynamics.jagger.storage.KeyValueStorage;
6 import com.griddynamics.jagger.storage.Namespace;
7 import com.griddynamics.jagger.storage.fs.logging.LogWriter;
8 import com.griddynamics.jagger.storage.fs.logging.MetricLogEntry;
9 import org.slf4j.Logger;
10 import org.slf4j.LoggerFactory;
13 import java.io.UnsupportedEncodingException;
14 import java.net.URLEncoder;
47 KeyValueStorage storage =
context.getService(KeyValueStorage.class);
56 public void saveValue(String metricId, Number value) {
57 long current = System.currentTimeMillis();
62 public void saveValue(String metricId, Number value,
long timeStamp) {
63 LogWriter logWriter =
context.getService(LogWriter.class);
65 metricId = URLEncoder.encode(metricId,
"UTF-8");
67 new MetricLogEntry(timeStamp, metricId, value));
68 }
catch (UnsupportedEncodingException e) {
69 log.error(
"Can't save metric value with id={}", metricId, e);
75 LogWriter logWriter =
context.getService(LogWriter.class);