forked from stackimpact/stackimpact-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMeasurement.java
More file actions
44 lines (33 loc) · 1.08 KB
/
Measurement.java
File metadata and controls
44 lines (33 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package com.stackimpact.agent.model;
import java.util.Map;
import java.util.HashMap;
public class Measurement {
public String id;
public String trigger;
public double value;
public long duration;
public Breakdown breakdown;
public long timestamp;
public Measurement(String id, String trigger, double value, long duration, Breakdown breakdown, long timestamp) {
this.id = id;
this.trigger = trigger;
this.value = value;
this.duration = duration;
this.breakdown = breakdown;
this.timestamp = timestamp;
}
public Map toMap() {
Map breakdownMap = null;
if (breakdown != null) {
breakdownMap = breakdown.toMap();
}
Map measurementMap = new HashMap();
measurementMap.put("id", id);
measurementMap.put("trigger", trigger);
measurementMap.put("value", value);
measurementMap.put("duration", duration);
measurementMap.put("breakdown", breakdownMap);
measurementMap.put("timestamp", timestamp);
return measurementMap;
}
}