Skip to content

Commit

Permalink
Merge pull request #1835 from denzelsN/master
Browse files Browse the repository at this point in the history
change date format of chart in inspector page
  • Loading branch information
denzelsN committed Jun 10, 2016
2 parents 5b670e8 + 6e30f3c commit 9318714
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
15 changes: 8 additions & 7 deletions web/src/main/webapp/common/services/agent-dao.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@
* @name AgentDaoService
* @class
*/
pinpointApp.constant('agentDaoServiceConfig', {
agentStatUrl: '/getAgentStat.pinpoint'
pinpointApp.constant( "agentDaoServiceConfig", {
agentStatUrl: "/getAgentStat.pinpoint",
dateFormat: "YYYY-MM-DD HH:mm:ss"
});

pinpointApp.service('AgentDaoService', [ 'agentDaoServiceConfig',
function AgentDaoService(cfg) {
pinpointApp.service( "AgentDaoService", [ "agentDaoServiceConfig",
function AgentDaoService( cfg ) {

/**
* (en)선택한 Agent의 Chart 정보를 로드함.
Expand Down Expand Up @@ -72,7 +73,7 @@

for (var i = 0; i < pointsCount.length; ++i) {
var thisData = {
time: moment(pointsTime[i].timestamp).format('YYYY-MM-dd HH:mm:ss')
time: moment(pointsTime[i].timestamp).format( cfg.dateFormat )
};
for (var k in info.line) {
if (info.line[k].isFgc) {
Expand Down Expand Up @@ -147,7 +148,7 @@
throw new Error('assertion error', 'timestamp mismatch between jvmCpuLoad and systemCpuLoad');
}
var thisData = {
time: moment(pointsJvmCpuLoad[i].timestamp).toString('YYYY-MM-dd HH:mm:ss'),
time: moment(pointsJvmCpuLoad[i].timestamp).format( cfg.dateFormat ),
maxCpuLoad: 100
};
var jvmCpuLoad = typeof agentStat.charts['CPU_LOAD_JVM'].points[i].maxVal == "number" ? agentStat.charts['CPU_LOAD_JVM'].points[i].maxVal.toFixed(2) : 0.00;
Expand Down Expand Up @@ -188,7 +189,7 @@

for ( var i = 0 ; i < tpsLength ; i++ ) {
var thisData = {
time: moment(aSampledContinuationData[i].timestamp).toString('YYYY-MM-dd HH:mm:ss')
time: moment(aSampledContinuationData[i].timestamp).format( cfg.dateFormat )
};
var sampledContinuationTps = typeof aSampledContinuationData[i].avgVal == "number" ? aSampledContinuationData[i].avgVal.toFixed(2) : 0.00;
var sampledNewTps = typeof aSampledNewData[i].avgVal == "number" ? aSampledNewData[i].avgVal.toFixed(2) : 0.00;
Expand Down
3 changes: 3 additions & 0 deletions web/src/main/webapp/common/services/common-util.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@
this.isEmpty = function( target ) {
return angular.isUndefined( target ) || target === null || target === "";
};
this.random = function( start, end ) {
return Math.floor( Math.random() * ( end - start + 1 ) ) + start;
}
}]);
})();
4 changes: 2 additions & 2 deletions web/src/main/webapp/common/services/progress-bar.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @name ProgressBarService
* @class
*/
pinpointApp.factory('ProgressBarService', [ '$timeout', '$window', '$location', 'UserLocalesService', function ($timeout, $window, $location, UserLocalesService) {
pinpointApp.factory( "ProgressBarService", [ "$timeout", "$window", "$location", "CommonUtilService", "UserLocalesService", function ($timeout, $window, $location, CommonUtilService, UserLocalesService) {
var AVAILABLE_LOCALE = [ "ko", "en" ];
var TIP_MAX_COUNT = 5;
var STORAGE_NAME = "__HIDE_LOADING_TIP";
Expand Down Expand Up @@ -77,7 +77,7 @@
if (this.bAutoIncrease === false) {
return;
}
var nRandom = _.random(1, 4);
var nRandom = CommonUtilService.random( 1, 4 );
if (this.nPercentage + nRandom <= 99) {
this.setLoading(this.nPercentage + nRandom);

Expand Down
1 change: 0 additions & 1 deletion web/src/main/webapp/features/agentInfo/agentInfo.html

This file was deleted.

Empty file.

0 comments on commit 9318714

Please sign in to comment.