stable

Clone or download

Read-only

request #12818: Add metrics about Git LFS usage

This contribution adds a few metrics about the Git LFS usage: - number of accepted requests for the upload and download of a Git LFS object - quantity of data received/transmitted to save/allow to download a Git LFS object - number of locks created and deleted For the data we sent, we count the data read from the object instead of the data we really output. PHP does not seem to play well with a stream filter and writing to php://output, the memory limit is reached. Both values are anyway very close, in the worst case scenario one full buffer (8192 bytes by default) can be lost. Change-Id: I5fa5071b2500682279f7b5584276745bc022f334

Modified Files

Name
M plugins/gitlfs/include/Batch/Response/BatchSuccessfulResponseBuilder.php +18 −1 Go to diff View file
M plugins/gitlfs/include/Download/FileDownloaderController.php +22 −4 Go to diff View file
M plugins/gitlfs/include/Lock/Controller/LFSLockCreateController.php +13 −1 Go to diff View file
M plugins/gitlfs/include/Lock/Controller/LFSLockDeleteController.php +9 −1 Go to diff View file
M plugins/gitlfs/include/StreamFilter/FilterInterface.php +4 −10 Go to diff View file
M plugins/gitlfs/include/StreamFilter/StreamFilterWrapper.php +7 −2 Go to diff View file
M plugins/gitlfs/include/Transfer/Basic/BlockToMaxSizeOnReadFilter.php +9 −5 Go to diff View file
M plugins/gitlfs/include/Transfer/Basic/LFSBasicTransferDownloadController.php +22 −4 Go to diff View file
M plugins/gitlfs/include/Transfer/Basic/LFSBasicTransferObjectSaver.php +16 −5 Go to diff View file
M plugins/gitlfs/include/Transfer/Basic/SHA256ComputeOnReadFilter.php +8 −10 Go to diff View file
A plugins/gitlfs/include/Transfer/BytesAmountHandledLFSObjectInstrumentationFilter.php +103 −0 Go to diff View file
M plugins/gitlfs/include/gitlfsPlugin.class.php +12 −6 Go to diff View file
M plugins/gitlfs/phpunit/Batch/Response/BatchSuccessfulResponseBuilderTest.php +16 −7 Go to diff View file
M plugins/gitlfs/phpunit/StreamFilter/ReplaceDataFilter.php +7 −6 Go to diff View file
M plugins/gitlfs/phpunit/StreamFilter/StreamFilterTest.php +23 −0 Go to diff View file
M plugins/gitlfs/phpunit/StreamFilter/StreamFilterWrapperTest.php +31 −2 Go to diff View file
M plugins/gitlfs/phpunit/Transfer/Basic/LFSBasicTransferObjectSaverTest.php +33 −5 Go to diff View file
A plugins/gitlfs/phpunit/Transfer/BytesAmountHandledLFSObjectInstrumentationFilterTest.php +71 −0 Go to diff View file
M src/common/Instrument/Prometheus/Prometheus.php +12 −1 Go to diff View file