monocle
monocle copied to clipboard
Search fields (merge time)
Is it possible to filter search by merge time? I see the metric reported and used in the x-axis of the complexity chart but I don't see the ability to use that as a field in search.
Alternatively, should I be using an API to the monocle host to query merge time from a subset of repos?
Hi Chris,
It is not for the moment but the duration attribute which is the delay between the time a change has been created and the time a change has been merged is available in the Monocle database for every merged change. So adding that filter in the query language should be possible. I'll give it a try.
What do you mean by "a subset of repos" ?
Subset of repos for me simply means filtering on repo-name which is already possible.
You can use the 'CHANGES' query type to fetch changes and compute the merge time via the 'created_at' and 'merged_at' fields.
curl 'https://demo.changemetrics.io/api/2/search/query' -H 'Content-Type: application/json' --data '{"index":"python","query":"(from:now-3weeks)","query_type":"QUERY_CHANGE","order":{"field":"updated_at","direction":"DESC"},"limit":"256","change_id":""}'
Thanks to #927 and #928:
- [api] Add support for the 'ttm' field in the query language. The field allows to filter on merged changes of a specific duration (in seconds).
- [api] Expose the duration field of the change object. Duration is the time to merge delay in seconds.