oso icon indicating copy to clipboard operation
oso copied to clipboard

Diff PLN metrics in OSO and ecosyste.ms

Open ryscheng opened this issue 2 years ago • 1 comments

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

ryscheng avatar Oct 06 '23 00:10 ryscheng

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

davidgasquez avatar Oct 11 '23 10:10 davidgasquez

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

Image

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

  • Releases
  • Comments
  • Avg Resp Time
  • Slow Responses

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 avatar Aug 26 '24 15:08 ccerv1

Created the following new issues:

  • [ ] https://github.com/opensource-observer/oso/issues/1991
  • [ ] https://github.com/opensource-observer/oso/issues/1992
  • [ ] https://github.com/opensource-observer/oso/issues/1993

ccerv1 avatar Aug 26 '24 15:08 ccerv1