{"id":19512364,"url":"https://github.com/colinianking/sluice","last_synced_at":"2026-02-13T14:14:17.659Z","repository":{"id":34204100,"uuid":"38060399","full_name":"ColinIanKing/sluice","owner":"ColinIanKing","description":"Sluice is a program that reads input on stdin and outputs on stdout at a specified data rate. ","archived":false,"fork":false,"pushed_at":"2025-01-01T22:55:25.000Z","size":251,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-19T07:06:39.321Z","etag":null,"topics":["data","rate-limiting","transfer"],"latest_commit_sha":null,"homepage":"https://github.com/ColinIanKing/sluice","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ColinIanKing.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-06-25T16:21:48.000Z","updated_at":"2025-07-24T10:17:29.000Z","dependencies_parsed_at":"2024-08-14T22:42:11.232Z","dependency_job_id":"02c60fd4-e205-4753-9991-01d50598d7e6","html_url":"https://github.com/ColinIanKing/sluice","commit_stats":null,"previous_names":[],"tags_count":38,"template":false,"template_full_name":null,"purl":"pkg:github/ColinIanKing/sluice","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColinIanKing%2Fsluice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColinIanKing%2Fsluice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColinIanKing%2Fsluice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColinIanKing%2Fsluice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ColinIanKing","download_url":"https://codeload.github.com/ColinIanKing/sluice/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColinIanKing%2Fsluice/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272063615,"owners_count":24866766,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-25T02:00:12.092Z","response_time":1107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data","rate-limiting","transfer"],"created_at":"2024-11-10T23:25:40.285Z","updated_at":"2026-02-13T14:14:12.628Z","avatar_url":"https://github.com/ColinIanKing.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sluice\n\nSluice is a program that reads input on stdin and outputs on stdout at a specified data rate.\n\n# Sluice command line options\n\n* -a append to file (-t, -O options only).\n* -c specify the constant delay time between each write.\n* -d discard data, do not copy it to stdout. This makes sluice act as a data sink.\n* -e skip read errors.\n* -f specify the frequency of -v verbose statistics updates.\n* -h print help.\n* -i specify the read/write size.\n* -m specify amount of data to process.\n* -n no rate controls, just copy data untouched.\n* -o detect overflow and re-size read/write buffer size to stop overflows.\n* -p enable verbose mode with progress and ETA statistics.\n* -O short cut for -dt; output to a file.\n* -r specify the data rate.\n* -R ignore stdin, read random data from /dev/urandom.\n* -s set delay shift, controls delay adjustment.\n* -S display statistics at end of stream to stderr.\n* -t tee output to the specified file.\n* -T stop after a specified amount of time.\n* -u detect underflow and re-size read/write buffer.\n* -v write verbose statistics to stderr.\n* -V print version information.\n* -w warn if a long burst of continuous data rate underflow occur.\n* -z ignore stdin, generate zeros. \n\nNote that suffixes of B, K, M and G specify sizes and rates in bytes, Kbytes, Mbytes and Gbytes respectively.\n\n# Sluice signal handling\n\nkilling sluice with the following signals will toggle the following modes:\n\n* SIGUSR1 toggle -v verbose mode\n* SIGUSR2 toggle -o -u overrun/underrun modes \n\n# Example\n\n```\ncat /dev/zero | sluice -r 64K -v -m 32M \u003e /dev/null\n\nsluice -R -r 2M -T 1m -S -i 4K \u003e myfifo\nData:            119.99 MB\nReads:           30718\nWrites:          30718\nAvg. Write Size: 4.00 KB\nDuration:        60.000 secs\nTarget rate:     2.00 MB/sec\nAverage rate:    2.00 MB/sec\nMinimum rate:    1.42 MB/sec\nMaximum rate:    2.19 MB/sec\nDrift from target rate: (%)\n   0.00% -  0.99%:  99.43%\n   1.00% -  1.99%:   0.31%\n   2.00% -  3.99%:   0.16%\n   4.00% -  7.99%:   0.07%\n   8.00% - 15.99%:   0.02%\n  16.00% - 31.99%:   0.02%\n  32.00% - 63.99%:   0.00%\n \u003e64.00%         :   0.00%\nOverruns:        47.41%\nUnderruns:       52.46%\nUser time:       0.180 secs\nSystem time:     19.100 secs\n```\n\n# Why so many tweakables?\n\nSluice provides different ways to adjust the data rate for specific\nuse-cases. The -i option allows one to specify the read/write size and \nhence the only the delay between writes can be used to control the data\nrate. Using the -o and -u options allows further adjustment of the write\nsize to help reach the desired rate faster. \n\nThe -s option allows sluice to add more control to the data rate adjustments.\nThe delay time or buffer sizes are modified by the previous values right\nshifted by the -s shift value. The larger the shift value the smaller the\nmodification, and hence the longer it will take to reach the desired data\nrate. The smaller the shift value the quicker it will take sluice to reach\nthe desired data rate, however, it can cause large overruns or underrun\noscillations which are not desirable. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolinianking%2Fsluice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcolinianking%2Fsluice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolinianking%2Fsluice/lists"}