Skip to end of banner
Go to start of banner

How Charts & Graphs for Bitbucket prepares data for reports

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

The Charts & Graphs for Bitbucket app uses indexes to keep statistics for file types and repository contributors. These indexes help show reports faster and are stored in tables in the Bitbucket database.

To keep stats up to date the app listens for repository reference change events. These events are triggered when the users pushes commits, creates or deletes branches, merges pull requests, etc.

Which branches are indexed?

For performance reasons, only the default branch (typically master) is indexed for filetype information. Author information is gathered for all branches. Note that changing the default branch in the repository configuration doesn’t trigger a re-index. In this case, you may trigger an index manually.

Triggering index via User Interface

If the repository hasn't been indexed yet (for example plugin is just installed) indexing starts when users open repository browse page or repository contributors reports. Some reports like Project Contributors or User Contributions do not start indexing as they can not be associated with particular repository. This has one major consequence: if there is no repository activity (for example if plugin is running on test instance) than Project contributors report wont show any data.

Indexing Threads 

The app uses 2 threads for indexing. We keep this number small to avoid performance issues. If events are triggered while both threads are busy then such events are dropped. Every time indexing is called it accounts all new changes in the repository (not only associated with particular event). So nothing is lost when events are dropped. 

Indexing API

Also there is a REST API to re-create index for a repository. It cleans all stats for the repository and then re-creates the index from scratch. Details of the API can be found here.

Error rendering macro 'excerpt-include' : No link could be created for 'DOC:Service Level Agreement'.




  • No labels