Class: Athenian::MetricsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/athenian/api/metrics_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ MetricsApi

Returns a new instance of MetricsApi.



16
17
18
# File 'lib/athenian/api/metrics_api.rb', line 16

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



14
15
16
# File 'lib/athenian/api/metrics_api.rb', line 14

def api_client
  @api_client
end

Instance Method Details

#calc_code_bypassing_prs(body, opts = {}) ⇒ Array<CodeBypassingPRsMeasurement>

Measure the amount of code that was pushed outside of pull requests.

Parameters:

  • body (CodeFilter)

    Query for measuring the amount of code that was pushed outside of pull requests.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



23
24
25
26
# File 'lib/athenian/api/metrics_api.rb', line 23

def calc_code_bypassing_prs(body, opts = {})
  data, _status_code, _headers = calc_code_bypassing_prs_with_http_info(body, opts)
  data
end

#calc_code_bypassing_prs_with_http_info(body, opts = {}) ⇒ Array<(Array<CodeBypassingPRsMeasurement>, Integer, Hash)>

Measure the amount of code that was pushed outside of pull requests.

Parameters:

  • body (CodeFilter)

    Query for measuring the amount of code that was pushed outside of pull requests.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Array<CodeBypassingPRsMeasurement>, Integer, Hash)>)

    Array<CodeBypassingPRsMeasurement> data, response status code and response headers



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/athenian/api/metrics_api.rb', line 32

def calc_code_bypassing_prs_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MetricsApi.calc_code_bypassing_prs ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling MetricsApi.calc_code_bypassing_prs"
  end
  # resource path
  local_var_path = '/metrics/code_bypassing_prs'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
    header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'Array<CodeBypassingPRsMeasurement>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apiKeyAuth', 'bearerAuth']

  new_options = opts.merge(
    :operation => :"MetricsApi.calc_code_bypassing_prs",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MetricsApi#calc_code_bypassing_prs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#calc_metrics_code_checks(body, opts = {}) ⇒ CalculatedCodeCheckMetrics

Calculate metrics on continuous integration runs, such as GitHub Actions, Jenkins, Circle, etc.

Parameters:

  • body (CodeCheckMetricsRequest)

    Select the check runs of interest and the metrics to calculate.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



89
90
91
92
# File 'lib/athenian/api/metrics_api.rb', line 89

def calc_metrics_code_checks(body, opts = {})
  data, _status_code, _headers = calc_metrics_code_checks_with_http_info(body, opts)
  data
end

#calc_metrics_code_checks_with_http_info(body, opts = {}) ⇒ Array<(CalculatedCodeCheckMetrics, Integer, Hash)>

Calculate metrics on continuous integration runs, such as GitHub Actions, Jenkins, Circle, etc.

Parameters:

  • body (CodeCheckMetricsRequest)

    Select the check runs of interest and the metrics to calculate.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CalculatedCodeCheckMetrics, Integer, Hash)>)

    CalculatedCodeCheckMetrics data, response status code and response headers



98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# File 'lib/athenian/api/metrics_api.rb', line 98

def calc_metrics_code_checks_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MetricsApi.calc_metrics_code_checks ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling MetricsApi.calc_metrics_code_checks"
  end
  # resource path
  local_var_path = '/metrics/code_checks'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
    header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'CalculatedCodeCheckMetrics'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apiKeyAuth', 'bearerAuth']

  new_options = opts.merge(
    :operation => :"MetricsApi.calc_metrics_code_checks",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MetricsApi#calc_metrics_code_checks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#calc_metrics_deployments(body, opts = {}) ⇒ Array<CalculatedDeploymentMetric>

Calculate metrics on deployments submitted by ‘/events/deployments`.

Parameters:

  • body (DeploymentMetricsRequest)

    Select the deployments of interest and the metrics to calculate.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



155
156
157
158
# File 'lib/athenian/api/metrics_api.rb', line 155

def calc_metrics_deployments(body, opts = {})
  data, _status_code, _headers = calc_metrics_deployments_with_http_info(body, opts)
  data
end

#calc_metrics_deployments_with_http_info(body, opts = {}) ⇒ Array<(Array<CalculatedDeploymentMetric>, Integer, Hash)>

Calculate metrics on deployments submitted by &#x60;/events/deployments&#x60;.

Parameters:

  • body (DeploymentMetricsRequest)

    Select the deployments of interest and the metrics to calculate.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Array<CalculatedDeploymentMetric>, Integer, Hash)>)

    Array<CalculatedDeploymentMetric> data, response status code and response headers



164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
# File 'lib/athenian/api/metrics_api.rb', line 164

def calc_metrics_deployments_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MetricsApi.calc_metrics_deployments ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling MetricsApi.calc_metrics_deployments"
  end
  # resource path
  local_var_path = '/metrics/deployments'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
    header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'Array<CalculatedDeploymentMetric>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apiKeyAuth', 'bearerAuth']

  new_options = opts.merge(
    :operation => :"MetricsApi.calc_metrics_deployments",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MetricsApi#calc_metrics_deployments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#calc_metrics_developers(body, opts = {}) ⇒ CalculatedDeveloperMetrics

Calculate metrics over developer activities.

Parameters:

  • body (DeveloperMetricsRequest)

    Query for selecting developers and measured activities.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



221
222
223
224
# File 'lib/athenian/api/metrics_api.rb', line 221

def calc_metrics_developers(body, opts = {})
  data, _status_code, _headers = calc_metrics_developers_with_http_info(body, opts)
  data
end

#calc_metrics_developers_with_http_info(body, opts = {}) ⇒ Array<(CalculatedDeveloperMetrics, Integer, Hash)>

Calculate metrics over developer activities.

Parameters:

  • body (DeveloperMetricsRequest)

    Query for selecting developers and measured activities.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CalculatedDeveloperMetrics, Integer, Hash)>)

    CalculatedDeveloperMetrics data, response status code and response headers



230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
# File 'lib/athenian/api/metrics_api.rb', line 230

def calc_metrics_developers_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MetricsApi.calc_metrics_developers ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling MetricsApi.calc_metrics_developers"
  end
  # resource path
  local_var_path = '/metrics/developers'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
    header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'CalculatedDeveloperMetrics'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apiKeyAuth', 'bearerAuth']

  new_options = opts.merge(
    :operation => :"MetricsApi.calc_metrics_developers",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MetricsApi#calc_metrics_developers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#calc_metrics_jira_linear(body, opts = {}) ⇒ Array<CalculatedJIRAMetricValues>

Calculate metrics over JIRA issue activities.

Parameters:

  • body (JIRAMetricsRequest)

    Query for selecting JIRA issues and measured activities.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



287
288
289
290
# File 'lib/athenian/api/metrics_api.rb', line 287

def calc_metrics_jira_linear(body, opts = {})
  data, _status_code, _headers = calc_metrics_jira_linear_with_http_info(body, opts)
  data
end

#calc_metrics_jira_linear_with_http_info(body, opts = {}) ⇒ Array<(Array<CalculatedJIRAMetricValues>, Integer, Hash)>

Calculate metrics over JIRA issue activities.

Parameters:

  • body (JIRAMetricsRequest)

    Query for selecting JIRA issues and measured activities.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Array<CalculatedJIRAMetricValues>, Integer, Hash)>)

    Array<CalculatedJIRAMetricValues> data, response status code and response headers



296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
# File 'lib/athenian/api/metrics_api.rb', line 296

def calc_metrics_jira_linear_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MetricsApi.calc_metrics_jira_linear ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling MetricsApi.calc_metrics_jira_linear"
  end
  # resource path
  local_var_path = '/metrics/jira'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
    header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'Array<CalculatedJIRAMetricValues>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apiKeyAuth', 'bearerAuth']

  new_options = opts.merge(
    :operation => :"MetricsApi.calc_metrics_jira_linear",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MetricsApi#calc_metrics_jira_linear\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#calc_metrics_prs(body, opts = {}) ⇒ CalculatedPullRequestMetrics

Calculate linear metrics over PRs.

Parameters:

Returns:



353
354
355
356
# File 'lib/athenian/api/metrics_api.rb', line 353

def calc_metrics_prs(body, opts = {})
  data, _status_code, _headers = calc_metrics_prs_with_http_info(body, opts)
  data
end

#calc_metrics_prs_with_http_info(body, opts = {}) ⇒ Array<(CalculatedPullRequestMetrics, Integer, Hash)>

Calculate linear metrics over PRs.

Parameters:

Returns:



362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
# File 'lib/athenian/api/metrics_api.rb', line 362

def calc_metrics_prs_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MetricsApi.calc_metrics_prs ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling MetricsApi.calc_metrics_prs"
  end
  # resource path
  local_var_path = '/metrics/pull_requests'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
    header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'CalculatedPullRequestMetrics'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apiKeyAuth', 'bearerAuth']

  new_options = opts.merge(
    :operation => :"MetricsApi.calc_metrics_prs",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MetricsApi#calc_metrics_prs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#calc_metrics_releases(body, opts = {}) ⇒ Array<CalculatedReleaseMetric>

Calculate linear metrics over releases.

Parameters:

  • body (ReleaseMetricsRequest)

    Desired metric definitions.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



419
420
421
422
# File 'lib/athenian/api/metrics_api.rb', line 419

def calc_metrics_releases(body, opts = {})
  data, _status_code, _headers = calc_metrics_releases_with_http_info(body, opts)
  data
end

#calc_metrics_releases_with_http_info(body, opts = {}) ⇒ Array<(Array<CalculatedReleaseMetric>, Integer, Hash)>

Calculate linear metrics over releases.

Parameters:

  • body (ReleaseMetricsRequest)

    Desired metric definitions.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Array<CalculatedReleaseMetric>, Integer, Hash)>)

    Array<CalculatedReleaseMetric> data, response status code and response headers



428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
# File 'lib/athenian/api/metrics_api.rb', line 428

def calc_metrics_releases_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MetricsApi.calc_metrics_releases ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling MetricsApi.calc_metrics_releases"
  end
  # resource path
  local_var_path = '/metrics/releases'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
    header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'Array<CalculatedReleaseMetric>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apiKeyAuth', 'bearerAuth']

  new_options = opts.merge(
    :operation => :"MetricsApi.calc_metrics_releases",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MetricsApi#calc_metrics_releases\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end