Float: alternate approach to nil hosts/services

This commit is contained in:
Kyle Kingsbury 2013-06-07 14:16:37 -07:00
parent 5bdeed02bb
commit 0f0c90d970

View file

@ -101,21 +101,8 @@
var servicePrefix = strings.commonPrefix( var servicePrefix = strings.commonPrefix(
_.pluck(this.data, 'riemannService')); _.pluck(this.data, 'riemannService'));
_.each(this.data, function(d) { _.each(this.data, function(d) {
d.label = ''; d.label = d.riemannHost.substring(hostPrefix.length) + ' ' +
if (d.riemannHost) { d.riemannService.substring(servicePrefix.length);
d.label += d.riemannHost.substring(hostPrefix.length);
} else {
d.label += 'nil';
}
d.label += ' ';
if (d.riemannService) {
d.label += d.riemannService.substring(servicePrefix.length);
} else {
d.label += 'nil';
}
// Empty labels are expanded back to full ones. // Empty labels are expanded back to full ones.
if (d.label === ' ') { if (d.label === ' ') {
d.label = d.riemannHost + ' ' + d.riemannService; d.label = d.riemannHost + ' ' + d.riemannService;
@ -149,8 +136,8 @@
if (this.series[key] === undefined) { if (this.series[key] === undefined) {
this.data.push({ this.data.push({
riemannKey: key, riemannKey: key,
riemannHost: event.host, riemannHost: event.host || 'nil',
riemannService: event.service, riemannService: event.service || 'nil',
lineWidth: this.lineWidth, lineWidth: this.lineWidth,
shadowSize: 0, shadowSize: 0,
data: [] data: []