forked from Netflix/spectator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
initial version of integration with lwc api
Still needs a lot of work, but is a minimal base version that will send data at the same frequency as publishing to Atlas. For more details on the server side see: Netflix/atlas#459. Future iteration needed for refactoring to honor frequency in the subscription, performance tuning, etc.
- Loading branch information
1 parent
a3eb6c2
commit 656334e
Showing
7 changed files
with
362 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
spectator-reg-atlas/src/main/java/com/netflix/spectator/atlas/EvalPayload.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/* | ||
* Copyright 2014-2016 Netflix, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.netflix.spectator.atlas; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
/** | ||
* Wraps a list of measurements with a set of common tags. The common tags are | ||
* typically used for things like the application and instance id. | ||
*/ | ||
class EvalPayload { | ||
|
||
private final long timestamp; | ||
private final List<Metric> metrics; | ||
|
||
/** Create a new instance. */ | ||
EvalPayload(long timestamp, List<Metric> metrics) { | ||
this.timestamp = timestamp; | ||
this.metrics = metrics; | ||
} | ||
|
||
/** Return the timestamp for metrics in this payload. */ | ||
public long getTimestamp() { | ||
return timestamp; | ||
} | ||
|
||
/** Return the metric values for the data for this payload. */ | ||
public List<Metric> getMetrics() { | ||
return metrics; | ||
} | ||
|
||
/** Metric value. */ | ||
static class Metric { | ||
private final String id; | ||
private final Map<String, String> tags; | ||
private final double value; | ||
|
||
/** Create a new instance. */ | ||
Metric(String id, Map<String, String> tags, double value) { | ||
this.id = id; | ||
this.tags = tags; | ||
this.value = value; | ||
} | ||
|
||
/** Id for the expression that this data corresponds with. */ | ||
public String getId() { | ||
return id; | ||
} | ||
|
||
/** Tags for identifying the metric. */ | ||
public Map<String, String> getTags() { | ||
return tags; | ||
} | ||
|
||
/** Value for the metric. */ | ||
public double getValue() { | ||
return value; | ||
} | ||
} | ||
} |
Oops, something went wrong.