-
Notifications
You must be signed in to change notification settings - Fork 2
Writers for multiple Time series database targets #110
Conversation
Cannot start a pipeline due to:
Click on pipeline status check Details link below for more information. |
- Implemented M3DB writer and store
- new config for InfluxDB - Logger fix for m3dbworkresultwriter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check code formatting through all the files. Cmd+Opt+L
should help.
if (config.isLogKairosdbErrors()) { | ||
LOG.error("KairosDB write path failed", ex); | ||
} | ||
dataServiceMetrics.markKairosError(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation
if (config.isLogKairosdbErrors()) { | ||
LOG.error("KairosDB write path failed", ex); | ||
} | ||
dataServiceMetrics.markKairosError(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it's abstract class, there should not be any DB-specific logic in here
} | ||
} | ||
|
||
protected abstract void store(List<GenericMetrics> metrics); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better to agree on methods arrangement inside the class. The most common one is public
-> protected
-> package private
-> private
.
|
||
public void formatTimeSeriesMetrics(final CheckData checkData, List<GenericMetrics> metrics) { | ||
|
||
if (null == config.getKairosdbTagFields() || config.getKairosdbTagFields().size() == 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This piece repeats the one from the constructor. Can we avoid duplication somehow?
private final Map<String, String> tags; | ||
|
||
public GenericDataPoint(String id, Long value, Map<String, String> tags) { | ||
this.id = id; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if id
here is better then name
or something...
@Override | ||
public void store(List<GenericMetrics> genericMetrics) { | ||
log.debug("Writing to InfluxDB ..."); | ||
Timer.Context c = metrics.getM3DBTimer().time(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
M3DB
timer in InfluxDb
writer...
final List<M3DbMetrics> points = new LinkedList<>(); | ||
for (GenericMetrics m : genericMetrics) { | ||
|
||
for (GenericMetrics.GenericDataPoint dp : m.getDataPoints()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would extract transformation from GenericMetrics
to M3DbMetrics
to a separate method for better readability
won't do now |
Fixes #111
Do not merge at the moment: In progress