Project

General

Profile

1
import * as prom from 'prom-client';
2

    
3

    
4
export class Prometheus {
5

    
6
  register = new prom.Registry();
7

    
8
  counters: Map<string, prom.Counter> = new Map<string, prom.Counter>([
9
    ["/", new prom.Counter({
10
      name: 'home',
11
      help: 'Home Page Counter',
12
      registers: [this.register]
13
    })],
14
    ["/search/publication", new prom.Counter({
15
      name: 'search_publication',
16
      help: 'Publication Landing Page Counter',
17
      registers: [this.register]
18
    })],
19
    ["/search/dataset", new prom.Counter({
20
      name: 'search_dataset',
21
      help: 'Dataset Landing Page Counter',
22
      registers: [this.register]
23
    })],
24
    ["/search/software", new prom.Counter({
25
      name: 'search_software',
26
      help: 'Software Landing Page Counter',
27
      registers: [this.register]
28
    })],
29
    ["/search/other", new prom.Counter({
30
      name: 'search_other',
31
      help: 'Other Landing Page Counter',
32
      registers: [this.register]
33
    })],
34
    ["/search/project", new prom.Counter({
35
      name: 'search_project',
36
      help: 'Project Landing Page Counter',
37
      registers: [this.register]
38
    })],
39
    ["/search/dataprovider", new prom.Counter({
40
      name: 'search_dataprovider',
41
      help: 'DataProvider Landing Page Counter',
42
      registers: [this.register]
43
    })],
44
    ["/search/organization", new prom.Counter({
45
      name: 'search_organization',
46
      help: 'organization Landing Page Counter',
47
      registers: [this.register]
48
    })],
49
    // ["/participate/deposit-datasets", new prom.Counter({
50
    //   name: 'participate_deposit_datasets',
51
    //   help: 'Participate Deposit Datasets Page Counter',
52
    //   registers: [this.register]
53
    // })],
54
    // ["/participate/deposit-datasets-result", new prom.Counter({
55
    //   name: 'participate_deposit_datasets_result',
56
    //   help: 'Participate Deposit Datasets Result Page Counter',
57
    //   registers: [this.register]
58
    // })],
59
    // ["/participate/deposit-subject-result", new prom.Counter({
60
    //   name: 'participate_deposit_subject_result',
61
    //   help: 'Participate Deposit Subject Result Page Counter',
62
    //   registers: [this.register]
63
    // })],
64
    // ["/participate/deposit-publications", new prom.Counter({
65
    //   name: 'participate_deposit_publications',
66
    //   help: 'Participate Deposit Publications Page Counter',
67
    //   registers: [this.register]
68
    // })],
69
    // ["/participate/deposit-publications-result", new prom.Counter({
70
    //   name: 'participate_deposit_publications_result',
71
    //   help: 'Participate Deposit Publications Result Page Counter',
72
    //   registers: [this.register]
73
    // })],
74
    ["/search/find", new prom.Counter({
75
      name: 'search_find',
76
      help: 'Main Search Page Counter',
77
      registers: [this.register]
78
    })],
79
    ["/search/find/publications", new prom.Counter({
80
      name: 'search_find_publications',
81
      help: 'Publications Search Page Counter',
82
      registers: [this.register]
83
    })],
84
    ["/search/find/datasets", new prom.Counter({
85
      name: 'search_find_datasets',
86
      help: 'Datasets Search Page Counter',
87
      registers: [this.register]
88
    })],
89
    ["/search/find/software", new prom.Counter({
90
      name: 'search_find_software',
91
      help: 'Software Search Page Counter',
92
      registers: [this.register]
93
    })],
94
    ["/search/find/other", new prom.Counter({
95
      name: 'search_find_other',
96
      help: 'Other Search Page Counter',
97
      registers: [this.register]
98
    })],
99
    ["/search/find/projects", new prom.Counter({
100
      name: 'search_find_projects',
101
      help: 'Projects Search Page Counter',
102
      registers: [this.register]
103
    })],
104
    ["/search/find/dataproviders", new prom.Counter({
105
      name: 'search_find_dataproviders',
106
      help: 'DataProviders Search Page Counter',
107
      registers: [this.register]
108
    })],
109
    ["/search/find/organizations", new prom.Counter({
110
      name: 'search_find_organizations',
111
      help: 'Organizations Search Page Counter',
112
      registers: [this.register]
113
    })],
114
    // ["/search/content-providers", new prom.Counter({
115
    //   name: 'search_content_providers',
116
    //   help: 'Repositories Search Page Counter',
117
    //   registers: [this.register]
118
    // })],
119
    // ["/search/content-providers-table", new prom.Counter({
120
    //   name: 'search_content_providers_table',
121
    //   help: 'Repositories Search Page Table Counter',
122
    //   registers: [this.register]
123
    // })],
124
    // ["/search/entity-registries", new prom.Counter({
125
    //   name: 'search_entity_registries',
126
    //   help: 'Registries Search Page Counter',
127
    //   registers: [this.register]
128
    // })],
129
    // ["/search/entity-registries-table", new prom.Counter({
130
    //   name: 'search_entity_registries_table',
131
    //   help: 'Registries Search Page Table Counter',
132
    //   registers: [this.register]
133
    // })],
134
    // ["/search/journals", new prom.Counter({
135
    //   name: 'search_journals',
136
    //   help: 'Journals Search Page Counter',
137
    //   registers: [this.register]
138
    // })],
139
    // ["/search/journals-table", new prom.Counter({
140
    //   name: 'search_journals_table',
141
    //   help: 'Journals Search Page Table Counter',
142
    //   registers: [this.register]
143
    // })],
144
    ["/search/advanced/publications", new prom.Counter({
145
      name: 'search_advanced_publications',
146
      help: 'Publications Advanced Search Page Counter',
147
      registers: [this.register]
148
    })],
149
    ["/search/advanced/datasets", new prom.Counter({
150
      name: 'search_advanced_datasets',
151
      help: 'Datasets Advanced Search Page Counter',
152
      registers: [this.register]
153
    })],
154
    ["/search/advanced/software", new prom.Counter({
155
      name: 'search_advanced_software',
156
      help: 'Software Advanced Search Page Counter',
157
      registers: [this.register]
158
    })],
159
    ["/search/advanced/other", new prom.Counter({
160
      name: 'search_advanced_other',
161
      help: 'Other Advanced Search Page Counter',
162
      registers: [this.register]
163
    })],
164
    ["/search/advanced/projects", new prom.Counter({
165
      name: 'search_advanced_projects',
166
      help: 'Projects Advanced Search Page Counter',
167
      registers: [this.register]
168
    })],
169
    ["/search/advanced/dataproviders", new prom.Counter({
170
      name: 'search_advanced_dataproviders',
171
      help: 'DataProviders Advanced Search Page Counter',
172
      registers: [this.register]
173
    })],
174
    ["/search/advanced/organizations", new prom.Counter({
175
      name: 'search_advanced_organizations',
176
      help: 'Organizations Advanced Search Page Counter',
177
      registers: [this.register]
178
    })],
179
    // ["/myclaims", new prom.Counter({
180
    //   name: 'my_claims',
181
    //   help: 'My Claims Page Counter',
182
    //   registers: [this.register]
183
    // })],
184
    // ["/claims", new prom.Counter({
185
    //   name: 'claims',
186
    //   help: 'Admin Claims Page Counter',
187
    //   registers: [this.register]
188
    // })],
189
    // ["/participate/claim", new prom.Counter({
190
    //   name: 'participate_claim',
191
    //   help: 'Linking Page Counter',
192
    //   registers: [this.register]
193
    // })],
194
    // ["/participate/direct-claim", new prom.Counter({
195
    //   name: 'participate_direct_claim',
196
    //   help: 'Direct Linking Page Counter',
197
    //   registers: [this.register]
198
    // })]
199
  ]);
200
}
(5-5/9)