Matteo Scandolo | 48d890f | 2015-12-14 17:36:09 -0800 | [diff] [blame] | 1 | 'use strict'; |
| 2 | (function () { |
| 3 | |
| 4 | const meters = [ |
| 5 | // service_1 |
| 6 | // - slice_1 |
| 7 | // - resource_1 |
| 8 | // service_2 |
| 9 | // - slice_2 |
| 10 | // - resource_2 |
| 11 | // - resource_3 |
| 12 | // - slice_3 |
| 13 | // - resource_4 |
| 14 | { |
| 15 | service: 'service_1', |
| 16 | slice: 'slice_1', |
| 17 | resource_name: 'resource_1', |
| 18 | resource_id: 'resource_id_1', |
| 19 | name: 'instance_1', |
| 20 | unit: 'instance' |
| 21 | }, |
| 22 | { |
| 23 | service: 'service_2', |
| 24 | slice: 'slice_2', |
| 25 | resource_name: 'resource_2', |
| 26 | resource_id: 'resource_id_2', |
| 27 | name: 'instance_2', |
| 28 | unit: 'instance' |
| 29 | }, |
| 30 | { |
| 31 | service: 'service_2', |
| 32 | slice: 'slice_2', |
| 33 | resource_name: 'resource_3', |
| 34 | resource_id: 'resource_id_3', |
| 35 | name: 'instance_2', |
| 36 | unit: 'instance' |
| 37 | }, |
| 38 | { |
| 39 | service: 'service_2', |
| 40 | slice: 'slice_3', |
| 41 | resource_name: 'resource_4', |
| 42 | resource_id: 'resource_id_4', |
| 43 | name: 'instance_3', |
| 44 | unit: 'instance' |
| 45 | } |
| 46 | ]; |
| 47 | |
| 48 | const samples = [ |
| 49 | { |
| 50 | meter: 'cpu', |
| 51 | resource_name: 'fakeName', |
Matteo Scandolo | d9e1c41 | 2015-12-15 14:37:27 -0800 | [diff] [blame] | 52 | project_id: 'fakeTenant', |
Matteo Scandolo | 48d890f | 2015-12-14 17:36:09 -0800 | [diff] [blame] | 53 | timestamp: '2015-12-15T00:34:08', |
| 54 | volume: 110 |
| 55 | }, |
| 56 | { |
| 57 | meter: 'cpu', |
| 58 | resource_name: 'fakeName', |
Matteo Scandolo | d9e1c41 | 2015-12-15 14:37:27 -0800 | [diff] [blame] | 59 | project_id: 'fakeTenant', |
Matteo Scandolo | 48d890f | 2015-12-14 17:36:09 -0800 | [diff] [blame] | 60 | timestamp: '2015-12-15T00:44:08', |
| 61 | volume: 120 |
| 62 | }, |
| 63 | { |
| 64 | meter: 'cpu', |
| 65 | resource_name: 'anotherName', |
Matteo Scandolo | d9e1c41 | 2015-12-15 14:37:27 -0800 | [diff] [blame] | 66 | project_id: 'anotherTenant', |
Matteo Scandolo | 48d890f | 2015-12-14 17:36:09 -0800 | [diff] [blame] | 67 | timestamp: '2015-12-15T00:24:08', |
| 68 | volume: 210 |
| 69 | }, |
| 70 | { |
| 71 | meter: 'cpu', |
| 72 | resource_name: 'anotherName', |
Matteo Scandolo | d9e1c41 | 2015-12-15 14:37:27 -0800 | [diff] [blame] | 73 | project_id: 'anotherTenant', |
Matteo Scandolo | 48d890f | 2015-12-14 17:36:09 -0800 | [diff] [blame] | 74 | timestamp: '2015-12-15T00:34:08', |
| 75 | volume: 220 |
| 76 | }, |
| 77 | { |
| 78 | meter: 'cpu', |
| 79 | resource_name: 'anotherName', |
Matteo Scandolo | d9e1c41 | 2015-12-15 14:37:27 -0800 | [diff] [blame] | 80 | project_id: 'anotherTenant', |
Matteo Scandolo | 48d890f | 2015-12-14 17:36:09 -0800 | [diff] [blame] | 81 | timestamp: '2015-12-15T00:44:08', |
| 82 | volume: 230 |
| 83 | }, |
| 84 | { |
| 85 | meter: 'cpu', |
| 86 | resource_name: 'thirdName', |
Matteo Scandolo | d9e1c41 | 2015-12-15 14:37:27 -0800 | [diff] [blame] | 87 | project_id: 'thirdTenant', |
Matteo Scandolo | 48d890f | 2015-12-14 17:36:09 -0800 | [diff] [blame] | 88 | timestamp: '2015-12-15T00:44:08', |
| 89 | volume: 310 |
| 90 | } |
| 91 | ]; |
| 92 | |
| 93 | angular.module('xos.ceilometerDashboard') |
| 94 | .run(($httpBackend) => { |
| 95 | $httpBackend.whenGET(/metersamples/).respond(samples); |
| 96 | $httpBackend.whenGET(/meters/).respond(meters); |
| 97 | }); |
| 98 | })(); |