Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add txObservers and make use of TXN Stats Collector object #943

Merged
merged 1 commit into from
Aug 12, 2020

Conversation

nklincoln
Copy link
Contributor

@nklincoln nklincoln commented Aug 3, 2020

BIG change here brings in transaction observer modules, and with it some other somewhat significant breaking changes that will need equally significant documentation changes:

Transaction observers are specified within the benchmark config file to be used by workers. They may use:

  • logging (used to log transactions)
  • prometheus-push (to push updates via a push gateway for scrape by prometheus)

An internal observer is always used, which is used to:

  • send updates to the manager process that might have enabled the default observer
  • send completion to the round orchestrator to use in building reports (there is only one way to build txStatistics report information, as the prometheus method is now invalid)
  • txUpdate interval is configured via internal property caliper-progress-reporting-interval (in ms)
  • txUpdate is disabled via internal property caliper-progress-reporting-enabled (true/false)

The local-observer is renamed to default-observer.

MessageHandler is renamed WorkerMessageHandler

All transaction statistics are collected, passed and manipulated via the TransactionStatisticsCollector class.

Workers no longer build an array of transactions to Promise.all in order to assure completion, we monitor for completion by taking advantage of aggregated results in the TransactionStatisticsCollector instance.

Rate controllers use the worker TransactionStatisticsCollector instance to determine required sleep times for rate control purposes

FixedBacklog controller renamed FixedLoad, since it aims to maintain a fixed txn load on the SUT

Updated generators to set different default values for txDuration and txNumber tests, as well as reduce the number of default workers (mainly to help the build).

Resource manager specification has been changed to mirror the specification of txStatsCollectors. This unifies the specification within the configuration file. A complete specification for monitors (transaction and resource, as per the integration tests) is:

monitors:
    transaction:
    - module: logging
      options:
        loggerModuleName: txinfo
        messageLevel: info
    - module: prometheus-push
      options:
        interval: 5
        push_url: "http://localhost:9091"
    resource:
    - module: prometheus
      options:
        interval: 5
        url: "http://localhost:9090"
        metrics:
            ignore: [prometheus, pushGateway, cadvisor, grafana, node-exporter]
            include:
                Endorse Time (s):
                    query: rate(endorser_propsal_duration_sum{chaincode="marbles:v0"}[1m])/rate(endorser_propsal_duration_count{chaincode="marbles:v0"}[1m])
                    step: 1
                    label: instance
                    statistic: avg
                Max Memory (MB):
                    query: sum(container_memory_rss{name=~".+"}) by (name)
                    step: 10
                    label: name
                    statistic: max
                    multiplier: 0.000001
        charting:
            polar:
                metrics: [Max Memory (MB)]
            bar:
                metrics: [all]
    - module: process
      options:
        interval: 3
        processes: [{ command: 'node', arguments: 'caliper.js', multiOutput: 'avg' }]
    - module: docker
      options:
        interval: 4
        containers: ['peer0.org1.example.com', 'peer0.org2.example.com', 'orderer0.example.com', 'orderer1.example.com']

closes #884
closes #826
closes #645

Signed-off-by: [email protected] [email protected]

@nklincoln nklincoln requested a review from aklenik August 3, 2020 12:42
@nklincoln nklincoln mentioned this pull request Aug 3, 2020
@aklenik aklenik self-assigned this Aug 4, 2020
Copy link
Contributor

@aklenik aklenik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing PR, long needed!!
I had some minor comments, but only the MessengerInterface ones are in the must-fix category.

@@ -37,13 +37,19 @@ const keys = {
Transparency: 'caliper-report-charting-transparency'
}
},
Progress: {
Reporting: {
Enabled: 'caliper-progress-reporting-enabled',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The enabled flag could be derived from interval !== 0. But I'm also fine with this explicit flag.

packages/caliper-core/lib/worker/caliper-worker.js Outdated Show resolved Hide resolved
@lgtm-com
Copy link

lgtm-com bot commented Aug 12, 2020

This pull request introduces 1 alert when merging e9aa4fc into c84d59f - view on LGTM.com

new alerts:

  • 1 for Unused variable, import, function or class

@nklincoln nklincoln merged commit a92ce49 into hyperledger-caliper:master Aug 12, 2020
@nklincoln nklincoln deleted the tx-observers branch August 12, 2020 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants