Bug 1952 - Uptime of running service instances not displayed correctly
*Modified the uptime of running instances to show time value
upto one decimal point.
*Corrected the api for VNF instances to show its proper count.
*Changed label of X axis from instances to NS instances in
graph.
Change-Id: Iaf339aaee175c39d528de5e0cf506e00316258ba
Signed-off-by: harshini.r <harshini.r@tataelxsi.co.in>
diff --git a/src/app/dashboard/DashboardComponent.ts b/src/app/dashboard/DashboardComponent.ts
index b7902a0..b3e48e4 100644
--- a/src/app/dashboard/DashboardComponent.ts
+++ b/src/app/dashboard/DashboardComponent.ts
@@ -57,7 +57,7 @@
/** Invoke service injectors @public */
public injector: Injector;
- /** handle translate @public */
+ /** Handle translate @public */
public translateService: TranslateService;
/** Observable holds logined value @public */
@@ -177,6 +177,9 @@
/** Contians hour converter @private */
private hourConverter: number = 3600;
+ /** Converter used to round off time to one decimal point @private */
+ private converter: number = 10;
+
/** Notifier service to popup notification @private */
private notifierService: NotifierService;
@@ -310,7 +313,7 @@
const now: Date = new Date();
const currentTime: number = Number((now.getTime().toString().slice(0, this.sliceLimit)));
this.createdTimes.forEach((createdTime: string): void => {
- this.noOfHours.push((Math.round((currentTime - Number(createdTime)) / this.hourConverter)));
+ this.noOfHours.push(Math.floor(((currentTime - Number(createdTime)) / this.hourConverter) * (this.converter)) / this.converter);
});
this.drawNsChart();
}
@@ -353,7 +356,7 @@
display: true,
scaleLabel: {
display: true,
- labelString: this.translateService.instant('INSTANCES')
+ labelString: this.translateService.instant('NSINSTANCES')
}
}],
yAxes: [{
@@ -373,7 +376,7 @@
/** Get VNFD instance details @public */
public getVnfInstanceCount(): void {
- this.vnfInstanceCountSub = this.restService.getResource(environment.NSDINSTANCES_URL)
+ this.vnfInstanceCountSub = this.restService.getResource(environment.VNFINSTANCES_URL)
.subscribe((vnfInstanceData: VNFInstanceDetails[]): void => {
this.vnfInstanceCount = vnfInstanceData.length;
}, (error: ERRORDATA): void => {