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

boost-library-stats.cpp.al #4

Open
sdarwin opened this issue Oct 11, 2022 · 4 comments
Open

boost-library-stats.cpp.al #4

sdarwin opened this issue Oct 11, 2022 · 4 comments

Comments

@sdarwin
Copy link

sdarwin commented Oct 11, 2022

Just to make a more official note about this. A script is compiling information about boost library # of issues, # of pull requests, # of lines of code, # of commits, and dumping the results into a postgres table.

https://boost-library-stats.cpp.al
Login Credentials : viewer / stats345!
Database "stats". Table "stats". And, then browse in "Views". view_2022_10_01

The statistics are an interesting summary of data about each library. That info could be displayed on the website, since the wireframes show library pages having "number of open issues", "number of commits". https://cppalliance.org/Boost-website-demo/2022-03/Library-Single-2x.html

A cron job runs collect_stats.py every month, but could be every hour, calculates the results, inserts them into a table, generates a "view" so that you can see only the latest information.

0 5 1 * * . $HOME/.web-env-vars && cd $HOME/boost_library_stats && ./scripts/collect_stats.py > /tmp/boost-library-stats.output 2>&1

https://github.com/CPPAlliance/boost-library-stats

Credentials are stored in /home/stats/.web-env-vars and loaded as environment variables.

export DATABASE_USER=
export DATABASE_PASSWORD=
export DATABASE_NAME=
export DATABASE_HOST=
export DATABASE_PORT=
export SECRET_KEY=
export DJANGO_SETTINGS_MODULE='boost_library_stats.settings'
export RESTMOTE_USER=
export RESTMOTE_PASSWORD=
export AWS_ACCESS_KEY_ID=
export AWS_SECRET_ACCESS_KEY=
export EMAIL_HOST=
export EMAIL_HOST_USER=
export EMAIL_HOST_PASSWORD=

boost-library-stats was written in python and even djangoified so it should be possible to run this script with the new website2022. It creates and updates one table, called stats. Then, the other webpages can query from stats and display the results.

@jzmaddock
Copy link

Looks great to me, would love to see this for other libraries too.

@sdarwin
Copy link
Author

sdarwin commented Oct 12, 2022

@jzmaddock glad you like it. If you navigate through the UI to Views, view_2022_10_01, Browse, it shows all boost libraries in the list. More than 100 libraries, sortable and paginated. When you say "other libraries", which do you mean?

In terms of web architecture, there could be more than one option. The first one, was to merge the features and functionality of boost-library-stats.cpp.al directly into the main website2022 project. Merge all the code. But then, another idea could be a more micro-services approach. This is already running on a server with persistent storage and a cron job, and all the website needs are USERNAME, PASSWORD, DATABASE_NAME, and it can query data remotely. So, just some ideas.

@jzmaddock
Copy link

If you navigate through the UI to Views, view_2022_10_01, Browse, it shows all boost libraries in the list. More than 100 libraries, sortable and paginated. When you say "other libraries", which do you mean?

OK got it, sorry I was looking in the wrong place. The database query is not not especially user friendly, but I really liked your demo web page, I was hoping for something more like that.

Another useful metric might be the rate at which PR's and issues are being opened and closed - ie are things getting better or worse?

@sdarwin
Copy link
Author

sdarwin commented Oct 12, 2022

The database query is not not especially user friendly

Using phppgadmin, I'd actually recommend avoiding queries in this case. In the view, it shows a table. Click on the column headers, to sort by "Issues" or "Pull Requests" or "Lines of Code". Scroll through the results with "Next" and "Prev". With these methods, no queries are needed.

demo web page

If this data is shown to end-users it should be on a more friendly front-end display. This direct database interface won't be published to the world, but it can be used to populate other web pages.

Another useful metric

The rate during which time frame? Probably shouldn't be for all times.
So, in the previous three months, issues were opened at an average rate of 5.2 per month and closed at an average rate of 4.3 per month, therefore issues are increasing at an average rate of .9 per month? If you are interested, you could propose the exact math calculations and text descriptions as they would appear on the website.

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

No branches or pull requests

2 participants