Skip to content

Commit 5fb705e

Browse files
committed
feat(metrics): add matrix and head matrix row counts
1 parent b6b5c90 commit 5fb705e

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

lib/pact_broker/matrix/row.rb

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
module PactBroker
99
module Matrix
10-
1110
class Row < Sequel::Model(:matrix)
1211

1312
# Used when using table_print to output query results

lib/pact_broker/metrics/service.rb

+8
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
require 'pact_broker/webhooks/webhook'
99
require 'pact_broker/webhooks/triggered_webhook'
1010
require 'pact_broker/webhooks/execution'
11+
require 'pact_broker/matrix/row'
12+
require 'pact_broker/matrix/head_row'
1113

1214
module PactBroker
1315
module Metrics
@@ -48,6 +50,12 @@ def metrics
4850
},
4951
webhookExecutions: {
5052
count: PactBroker::Webhooks::Execution.count
53+
},
54+
matrix: {
55+
count: PactBroker::Matrix::Row.count
56+
},
57+
headMatrix: {
58+
count: PactBroker::Matrix::HeadRow.count
5159
}
5260
}
5361
end

spec/features/metrics_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@
1818
end
1919

2020
it "returns some metrics" do
21-
expect(json_response_body).to be_instance_of(Hash)
21+
expect(json_response_body[:pacticipants]).to be_instance_of(Hash)
2222
end
2323
end

0 commit comments

Comments
 (0)