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 metrics for record count and http request time #11

Merged
merged 3 commits into from
Nov 8, 2018

Conversation

dmosorast
Copy link
Contributor

@dmosorast dmosorast commented Nov 7, 2018

This adds METRIC messages for relevant performance/volume stats. (HTTP request times and records emitted)

Records emitted will be printed as the sum of new and updated rows emitted at the end of a run, for simplicity. This is the new format of the end-of-sync report, with a request timer line included:

...
2018-11-07 20:49:52,397Z    tap - INFO message='Request to Stripe api' method=get path=https://api.stripe.com/v1/events?created[gte]=1541908800&created[lt]=1542513600
2018-11-07 20:49:52,558Z    tap - INFO METRIC Point(metric_type='timer', metric='http_request_duration', value=0.1576693058013916, tags={'status': 'succeeded', 'endpoint': 'events'})
2018-11-07 20:49:52,559Z    tap - INFO message='Stripe API response' path=https://api.stripe.com/v1/events?created[gte]=1541908800&created[lt]=1542513600 response_code=200
INFO METRIC: {"metric": "record_count", "value": 1, "type": "counter", "tags": {"endpoint": "transfers"}}
INFO METRIC: {"metric": "record_count", "value": 1, "type": "counter", "tags": {"endpoint": "events"}}
INFO METRIC: {"metric": "record_count", "value": 0, "type": "counter", "tags": {"endpoint": "subscription_items"}}
INFO METRIC: {"metric": "record_count", "value": 1, "type": "counter", "tags": {"endpoint": "plans"}}
INFO METRIC: {"metric": "record_count", "value": 0, "type": "counter", "tags": {"endpoint": "invoices"}}
INFO METRIC: {"metric": "record_count", "value": 1, "type": "counter", "tags": {"endpoint": "coupons"}}
INFO METRIC: {"metric": "record_count", "value": 1, "type": "counter", "tags": {"endpoint": "payouts"}}
INFO METRIC: {"metric": "record_count", "value": 0, "type": "counter", "tags": {"endpoint": "invoice_line_items"}}
INFO METRIC: {"metric": "record_count", "value": 1, "type": "counter", "tags": {"endpoint": "customers"}}
INFO METRIC: {"metric": "record_count", "value": 2, "type": "counter", "tags": {"endpoint": "invoice_items"}}
INFO METRIC: {"metric": "record_count", "value": 1, "type": "counter", "tags": {"endpoint": "balance_transactions"}}
INFO METRIC: {"metric": "record_count", "value": 1, "type": "counter", "tags": {"endpoint": "charges"}}
INFO METRIC: {"metric": "record_count", "value": 0, "type": "counter", "tags": {"endpoint": "subscriptions"}}
INFO ------------------
INFO transfers: 1 new, 0 updates
INFO events: 1 new, 0 updates
INFO subscription_items: 0 new, 0 updates
INFO plans: 1 new, 0 updates
INFO invoices: 0 new, 0 updates
INFO coupons: 1 new, 0 updates
INFO payouts: 1 new, 0 updates
INFO invoice_line_items: 0 new, 0 updates
INFO customers: 1 new, 0 updates
INFO invoice_items: 2 new, 0 updates
INFO balance_transactions: 1 new, 0 updates
INFO charges: 1 new, 0 updates
INFO subscriptions: 0 new, 0 updates
INFO ------------------
2018-11-07 20:49:52,664Z target - INFO Batch is valid
2018-11-07 20:49:52,665Z target - INFO Exiting normally

@dmosorast dmosorast merged commit bbbb5be into master Nov 8, 2018
@dmosorast dmosorast deleted the feature/add-metrics branch November 8, 2018 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant