Skip to content

Commit

Permalink
feat(metrics): add matrix and head matrix row counts
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque committed Oct 8, 2019
1 parent b6b5c90 commit 5fb705e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 0 additions & 1 deletion lib/pact_broker/matrix/row.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

module PactBroker
module Matrix

class Row < Sequel::Model(:matrix)

# Used when using table_print to output query results
Expand Down
8 changes: 8 additions & 0 deletions lib/pact_broker/metrics/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
require 'pact_broker/webhooks/webhook'
require 'pact_broker/webhooks/triggered_webhook'
require 'pact_broker/webhooks/execution'
require 'pact_broker/matrix/row'
require 'pact_broker/matrix/head_row'

module PactBroker
module Metrics
Expand Down Expand Up @@ -48,6 +50,12 @@ def metrics
},
webhookExecutions: {
count: PactBroker::Webhooks::Execution.count
},
matrix: {
count: PactBroker::Matrix::Row.count
},
headMatrix: {
count: PactBroker::Matrix::HeadRow.count
}
}
end
Expand Down
2 changes: 1 addition & 1 deletion spec/features/metrics_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
end

it "returns some metrics" do
expect(json_response_body).to be_instance_of(Hash)
expect(json_response_body[:pacticipants]).to be_instance_of(Hash)
end
end

0 comments on commit 5fb705e

Please sign in to comment.