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

Implement telemetry #234

Merged
merged 17 commits into from
Jul 24, 2020
Merged

Implement telemetry #234

merged 17 commits into from
Jul 24, 2020

Conversation

karniv00l
Copy link
Contributor

@karniv00l karniv00l commented Jul 22, 2020

This is full PR to master, I've rebased so I could use new Proxy service

@karniv00l karniv00l added this to the 0.5.0 milestone Jul 22, 2020
@karniv00l karniv00l requested a review from akondas July 22, 2020 17:35
@karniv00l karniv00l marked this pull request as draft July 22, 2020 17:39
src/Service/Telemetry.php Outdated Show resolved Hide resolved
src/Service/Telemetry.php Outdated Show resolved Hide resolved
Copy link
Member

@akondas akondas left a comment

Choose a reason for hiding this comment

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

Missing some tests, but generally looks good 👍

@codecov
Copy link

codecov bot commented Jul 23, 2020

Codecov Report

Merging #234 into master will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #234      +/-   ##
============================================
+ Coverage     99.65%   99.67%   +0.01%     
- Complexity     1422     1481      +59     
============================================
  Files           235      245      +10     
  Lines          4088     4318     +230     
============================================
+ Hits           4074     4304     +230     
  Misses           14       14              
Impacted Files Coverage Δ Complexity Δ
src/Command/CreateAdminCommand.php 100.00% <100.00%> (ø) 5.00 <1.00> (+2.00)
src/Command/SendTelemetryCommand.php 100.00% <100.00%> (ø) 5.00 <5.00> (?)
src/Controller/Admin/ConfigController.php 100.00% <100.00%> (ø) 6.00 <3.00> (+2.00)
src/Controller/IndexController.php 100.00% <100.00%> (ø) 2.00 <1.00> (+1.00)
src/Form/Type/Admin/ConfigType.php 100.00% <100.00%> (ø) 3.00 <1.00> (+1.00)
.../Query/Admin/TelemetryQuery/DbalTelemetryQuery.php 100.00% <100.00%> (ø) 11.00 <11.00> (?)
src/Repository/ConfigRepository.php 100.00% <100.00%> (ø) 4.00 <0.00> (ø)
src/Service/Config.php 100.00% <100.00%> (ø) 13.00 <1.00> (+1.00)
src/Service/Telemetry.php 100.00% <100.00%> (ø) 12.00 <12.00> (?)
src/Service/Telemetry/Entry.php 100.00% <100.00%> (ø) 2.00 <2.00> (?)
... and 16 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aec3462...5b999ee. Read the comment docs.

@karniv00l karniv00l marked this pull request as ready for review July 23, 2020 12:48
FROM "organization" o
LEFT JOIN "organization_token" t ON t.organization_id = o.id
LEFT JOIN "organization_member" m ON m.organization_id = o.id AND m.role = :role_member
LEFT JOIN "organization_member" ow ON ow.organization_id = o.id AND ow.role = :role_owner
Copy link
Member

Choose a reason for hiding this comment

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

This double join can be avoided with FILTER 😎

COUNT(m.id) FILTER (WHERE m.role = :role_member) AS members,
COUNT(m.id) FILTER (WHERE m.role = :role_owner) AS owners

check this please, I'm not sure 😉

COUNT(d.id) downloads,
COUNT(w.date) webhooks
FROM "organization_package" p
LEFT JOIN "organization_package_download" d ON d.package_id = p.id
Copy link
Member

Choose a reason for hiding this comment

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

missing AND d.date::date <= :till

src/Service/Telemetry.php Outdated Show resolved Hide resolved
]
);

if ($response->getStatusCode() >= 300) {
Copy link
Member

Choose a reason for hiding this comment

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

why 300? (I thought this client dealt with redirects) Maybe 400?

src/Service/Config.php Outdated Show resolved Hide resolved
src/Service/Telemetry.php Outdated Show resolved Hide resolved
@karniv00l karniv00l force-pushed the telemetry-rebased branch from 42a736d to 5b999ee Compare July 24, 2020 12:11
@akondas
Copy link
Member

akondas commented Jul 24, 2020

Thanks 🍻

@akondas akondas merged commit ce8e749 into repman-io:master Jul 24, 2020
@karniv00l karniv00l deleted the telemetry-rebased branch July 24, 2020 13:08
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.

2 participants