metricservice.js 833 B

123456789101112131415161718192021222324252627282930313233343536
  1. var app = angular.module('sentinelDashboardApp');
  2. app.service('MetricService', ['$http', function ($http) {
  3. this.queryAppSortedIdentities = function (params) {
  4. return $http({
  5. url: '/metric/queryTopResourceMetric.json',
  6. params: params,
  7. method: 'GET'
  8. });
  9. };
  10. this.queryByAppAndIdentity = function (params) {
  11. return $http({
  12. url: '/metric/queryByAppAndResource.json',
  13. params: params,
  14. method: 'GET'
  15. });
  16. };
  17. this.queryByMachineAndIdentity = function (ip, port, identity, startTime, endTime) {
  18. var param = {
  19. ip: ip,
  20. port: port,
  21. identity: identity,
  22. startTime: startTime.getTime(),
  23. endTime: endTime.getTime()
  24. };
  25. return $http({
  26. url: '/metric/queryByAppAndResource.json',
  27. params: param,
  28. method: 'GET'
  29. });
  30. };
  31. }]);