Workers Auto Approve
Feature: Analytics Endpoint
This is the first bounty in an upcoming set of bounties focused around building an analytics dashboard for projects that utilize the [standard bounties contract](https://github.com/Bounties-Network/StandardBounties) such as gitcoin, and other upcoming open source sites.
This first task begins the work of exposing endpoints around daily stats for a range of time. Ultimately, these will be used to build a react frontend connected to highcharts or other charting libraries. The data is already stored in PSQL, it just needs to be served up via the format requested below. This task ultimately requires just one endpoint to be built for now.
- endpoint should accept a start and end-date filter - `?publish_date__range=2016-01-01,2016-02-01` format
- Results need to be returned as **daily**. Daily represents 00:00 - 23:59 UTC time. The current day will of course be a partial day.
- endpoint should live in the newly added analytics directory/application - https://github.com/Bounties-Network/BountiesAPI/tree/master/bounties_api/analytics
- Url should be prefaced with /analytics route
- A new model should be introduced. This model should include a date field, along with the names of the requested stats. For now, I only foresee one model being created.
- A management job should be created. This job should be intended to run daily. Don't worry about setting up the scheduling - I'll put that work in after the PR. To see an example job/management command: https://github.com/Bounties-Network/BountiesAPI/blob/master/bounties_api/std_bounties/management/commands/get_token_values.py
- The job should fill in empty dates. For example, if the model and table is newly created and empty, the job should insert records for every day. Basically, the job should do calculations from the latest insertion date, but should not repeat work if the date has already been included.
- The endpoint should be an APIView - similar to these - https://github.com/Bounties-Network/BountiesAPI/blob/master/bounties_api/std_bounties/views.py#L83
- The job should already have the previous days pre-calculated. IT will be expected to run every 5 minutes, and therefore should update the current day's stats.
- This is time-series data! This means, the endpoint should return the values on each stat for each day in-between the range. **IN addition** to the timeseries data - it should also return the aggregates.
- Pep8 compliance required
- The BountyState table in models.py is essential to get the bounty stage data.
- Additionally should be able to filter by the Schema field on the Bounty model
- Total number of bounties issued
- Total number of fulfillments submitted
- Total number of fulfillments accepted
- Total number of fulfillments without acceptance
- Total fulfiller acceptance rate
- Total bounty fulfilled rate
- Average fulfiller acceptance rate
- Average bounty fulfilled rate
- Average fulfillment amount (usd_price)
- Total fulfillment amount
- Number of bounties in each bountyStage (each stage count would be a separate field on the model)
All of the above should be a separate field on one model that the job writes to. These should all be exposed on one api endpoint.
Example Response to `https://api.bounties.network/analytics/stats?publish_date__range=2016-01-01,2016-01-04`
The example response is missing the aggregate response. The aggregate response should include the values over the entire timerange.
## Definition of Done
- All requirements are completed above with the endpoint functional.
Myself and @mbeylin
## Review Requirements
- A WIP pull request along the way with initial progress
- Key questions posted here
- Conversational and longer discussions should be directed to the bounties network slack in this channel: https://bountiesnetwork.slack.com/messages/community-dev
Setup your profile
Tell us a little about you:
No results found for
Type to search skills..
Required [[totalcharacter]] / 240
Are you currently looking for work?
[[ option.string ]]
Setup your profile
Our tools are based on the principles of earn (💰), learn (📖), and meet (💬).
Select the ones you are interested in. You can change it later in your settings.
I'm also an organization manager looking for a great community.
Enable your organization profile
Gitcoin products can help grow community around your brand. Create your tribe, events, and incentivize your community with bounties. Announce new and upcoming events using townsquare. Find top-quality hackers and fund them to work with you on a grant.
These are the organizations you own. If you don't see your organization here please be sure that information is public on your GitHub profile. Gitcoin will sync this information for you.
Select the products you are interested in:
Out of the box you will receive Tribes Lite for your organization. Please provide us with a contact email: