-
Notifications
You must be signed in to change notification settings - Fork 167
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
feat: add cargo metric statements and dummy data inserts for testing … #1835
Conversation
Deploying with Cloudflare Pages
|
@@ -9,7 +9,7 @@ services: | |||
- 3000:3000/tcp | |||
environment: | |||
PGRST_DB_URI: postgres://postgres:postgres@db:5432/postgres | |||
PGRST_DB_SCHEMA: public | |||
PGRST_DB_SCHEMAS: public,cargo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is so we can query the cargo schema through postgrest
|
||
return data.reduce((obj, curr) => { | ||
const dagByteSizeHistory = metricsLogQuery |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should return a promise, that we can then pass into promise.all
packages/api/src/utils/db-client.js
Outdated
|
||
// Simple splatting of the metrics from first query | ||
if (primaryMetrics && primaryMetrics.length) { | ||
for (const metric of primaryMetrics) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could also use .map to transform this, this felt better with the checks for existence than using object.keys.map.
|
||
it('should return proper response for cid v1', async () => { | ||
const demoData = { | ||
deals_size_total: 169389985753391, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are taken directly from hard coded seed data inside of the cargo.testing.sql file
@alanshaw can we get a review of this please. |
Co-authored-by: Alan Shaw <alan.shaw@protocol.ai>
Co-authored-by: Alan Shaw <alan.shaw@protocol.ai>
d5209e7
to
c3b19a0
Compare
Codecov Report
@@ Coverage Diff @@
## main #1835 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 5 5
Lines 1242 1242
=========================================
Hits 1242 1242 Continue to review full report at Codecov.
|
Adds cargo metrics/metrics_log remote schema to the application.
Adds the cargo schema to the postgrest schema list for access.
Adds query to find necessary data for diffing.
Adds some generic seed data for populating local database.
Updates frontend to support new dag filecoine deals bytes growth rate week over week.
NOTE: This needs deploy of #1799
Will resolve following issues:
#1783
#1784
#1786
#1800