opensource-observer / oso

Measuring the impact of open source software
https://opensource.observer
Apache License 2.0
66 stars 17 forks source link

Diff PLN metrics in OSO and ecosyste.ms #313

Closed ryscheng closed 1 week ago

ryscheng commented 11 months ago

What is it?

https://ipfs.ecosystem-dashboard.com/ https://libp2p.ecosystem-dashboard.com/ https://filecoin.ecosystem-dashboard.com/ https://github.com/ipfs-shipyard/ecosystem-dashboard

davidgasquez commented 11 months ago

Heads up! Last I checked the PLN metrics weren't very accurate. :see_no_evil:

ccerv1 commented 1 week ago

Here is a screenshot of the metrics from the IPFS dashboard:

Image

OSO currently tracks 8/12 metrics. The missing four metrics are:

Releases and comments are straightforward to include in the OSO event model as they simply represent a new event type.

However, the two metrics related to response time require some changes to the underlying OSO event model. Critically, we need to introduce some concept of an event_id and event_source_id. Trivially, we also need to create a new event type for COMMENTED.

Once this has been done, the implementation of the avg_resp_time metric might look like:

SELECT
  i.sample_date,
  i.event_source,
  i.to_group_id, -- project, collection, or artifact id
  'AVERAGE_RESPONSE_TIME' AS metric
  AVG(TIMESTAMPDIFF(SECOND, i.time, c.time)) / 60 AS amount
FROM events AS i
LEFT JOIN events AS c
  ON i.event_id = c.event_id
  AND c.time = (
    SELECT MIN(c1.time)
    FROM events AS c1
    WHERE
      c1.event_id = i.event_id
      AND event_type = 'COMMENTED'
  )
WHERE
  i.event_type IN ('ISSUE_OPENED', 'PR_OPENED')
  AND c.event_type = 'COMMENTED'
GROUP BY
  i.sample_date,
  i.event_source,
  i.to_group_id;
ccerv1 commented 1 week ago

Created the following new issues: