Skip to content

Commit

Permalink
fixing bugs from time offset
Browse files Browse the repository at this point in the history
  • Loading branch information
simianhacker committed Jan 13, 2017
1 parent ee52e34 commit 16b7469
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default panel => error => {
console.log(error);
const result = {};
let errorResponse;
try {
Expand Down
16 changes: 8 additions & 8 deletions src/core_plugins/metrics/server/lib/vis_data/handle_response.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export default panel => resp => {
points: { show: false }
});
} else {
result.series.push({
result.push({
id: `${percentile.id}:${term.key}`,
color: color.hexString(),
label,
Expand All @@ -83,7 +83,7 @@ export default panel => resp => {
});
} else {
const data = term.timeseries.buckets.map(mapBucket(metric));
result.series.push({
result.push({
id: `${series.id}:${term.key}`,
label: term.key,
color: color.hexString(),
Expand All @@ -108,14 +108,14 @@ export default panel => resp => {
}
const upperData = buckets.map(mapBucketByMode('upper'));
const lowerData = buckets.map(mapBucketByMode('lower'));
result.series.push({
result.push({
id: `${series.id}:lower`,
lines: { show: true, fill: false, lineWidth: 0 },
points: { show: false },
color: series.color,
data: lowerData
});
result.series.push({
result.push({
id: `${series.id}:upper`,
label: series.label || calculateLabel(metric, series.metrics),
color: series.color,
Expand All @@ -124,12 +124,12 @@ export default panel => resp => {
fillBetween: `${series.id}:lower`,
data: upperData
});
} else {
} else if(buckets) {
const data = buckets.map(bucket => {
const sibBucket = _.get(aggs, `${series.id}`);
return [bucket.key, getSiblingAggValue(sibBucket, metric)];
});
result.series.push({
result.push({
id: series.id,
label: series.label || calculateLabel(metric, series.metrics),
color: series.color,
Expand All @@ -140,7 +140,7 @@ export default panel => resp => {
} else if (metric.type === 'std_deviation' && metric.mode === 'band') {
const upper = buckets.map(mapBucket(_.assign({}, metric, { mode: 'upper' })));
const lower = buckets.map(mapBucket(_.assign({}, metric, { mode: 'lower' })));
result.series.push({
result.push({
id: `${series.id}:upper`,
label: series.label || calculateLabel(metric, series.metrics),
color: series.color,
Expand All @@ -149,7 +149,7 @@ export default panel => resp => {
fillBetween: `${series.id}:lower`,
data: upper
});
result.series.push({
result.push({
id: `${series.id}:lower`,
color: series.color,
lines: { show: true, fill: false, lineWidth: 0 },
Expand Down

0 comments on commit 16b7469

Please sign in to comment.