From 7bc9c63c9da678a7e6fceb095d56c634afd22c56 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sun, 15 Dec 2019 18:09:03 +0000 Subject: gentoo resync : 15.12.2019 --- app-benchmarks/ioping/Manifest | 5 +- .../ioping/files/ioping-1.1-netdata.patch | 141 +++++++++++++++++++++ app-benchmarks/ioping/ioping-1.1.ebuild | 30 +++++ app-benchmarks/ioping/metadata.xml | 3 + 4 files changed, 178 insertions(+), 1 deletion(-) create mode 100644 app-benchmarks/ioping/files/ioping-1.1-netdata.patch create mode 100644 app-benchmarks/ioping/ioping-1.1.ebuild (limited to 'app-benchmarks/ioping') diff --git a/app-benchmarks/ioping/Manifest b/app-benchmarks/ioping/Manifest index 4399981a58b3..48d6d55e5aa4 100644 --- a/app-benchmarks/ioping/Manifest +++ b/app-benchmarks/ioping/Manifest @@ -1,6 +1,9 @@ AUX ioping-0.9-sysmacros.patch 711 BLAKE2B 4614c8aada443a0800d427dc0e8858e6120fc3d8496af5bf24744300b7b92d9765c97e605dd297afee1090695089bef8623f4639c917737b66b6c990e726dcbf SHA512 93f3a64610bff6970b9a9add9266766953aef1c2ec50afc683154617ddf7698cb72438ece6bfa08609fc5ca2d92b1291b75cca853ebf995b67c0279ea4420557 +AUX ioping-1.1-netdata.patch 4071 BLAKE2B c7dfca386a6e35d9d076eb0ce60e62e5b68d69cb02b69d1a0928da070454df15a50c1cd6c9dedf4a3fb559dac3749375b236905f089cd46894a5cb13dfdf4979 SHA512 3b8dae8089c4848b96402ccbf955fd6b28ad7eb772b7491c43f26dff8581a6143b86d20f193a73ba3d6eeea5d1c9bbb0c58ab6d5a60041ed9fc068207f522047 DIST ioping-0.9.tar.gz 23695 BLAKE2B 41b37ad8dabd2c2e16f26798d878807c38e0d03bc4964a001f8800d0f398ba48335b1187e1f04cd235a980c5dce7e864c471fce8d46ca24a65f2022847eb8ebd SHA512 609e19c31a16a5961be0e468255f2853311162ad988d07404a8198042bec1e20cab37e192ad148536a0772efe8034a94d594671ec6fde7d37badee859796de1c DIST ioping-1.0.tar.gz 28824 BLAKE2B bb0f28e560419167450b27846650ff131c9cbb23c5df7f518afa8cea6a83bd97142d7ad8920b9ec86754deea0dcbf36af923223c78df6488f3623f2df852b59c SHA512 a6763ac800e98c819a74af80634ac723f413ffa183297918389e1e1f5fc83713b683d53b594f5bd20f11d168c21de5da9d42a215d78531ee8b619aff8b9b0b84 +DIST ioping-1.1.tar.gz 29251 BLAKE2B 2f0ec642c3545b8e603f90187f48bf44e1ef665a99bc04af4d5e6441016c9509875e8e05c1cc8715fd080c8a498c7374cf5db562a3203d7075edbe85683ccdbb SHA512 67802a6ab552ad1fdb8894f4d814601c2f66154f4bfc50fa0001d881694864c1a70882b4ba2d0f50cbd484472dc649a22b312f802a3bacc3317671971bdc0201 EBUILD ioping-0.9.ebuild 788 BLAKE2B f9ed84de7b23052c1255fd157e4e417315fcf4147c713fbb5e753203006905e6ddc868e4c6e730b51be6a5f46a68a5d2e87511b879f3b86e8584105ea81c33d2 SHA512 ddfa5c09cdcd32011ef6b16480008d5df66c826e37168a27443d876704597c8ba5ca4af4f0cd4c9b3928f2eaa7d904362b39c804a670e7a65a886583a2b3ffab EBUILD ioping-1.0.ebuild 637 BLAKE2B 1ecc2edcb820b7841e8ea2d2fa888314fa03d2cfce2fa8274331df60b3ab5b7d81484afddd85082645e0da70f09f71d4872daa4e49c7d3a711201444cbb918d4 SHA512 a4e9cb7dcaa6537698ea75674a8557a7c2d3e7ab5dafbd60a334d426dd76298aa9f0f7a2e105704287cc2d153d816e7e72fecc58ac038f65b78708d644036b7a -MISC metadata.xml 486 BLAKE2B fbc1415094e68a44186c5d7ec7c5f8deb7f66c2aa38328eb4a93610fe1b14a6fcbbc1df32cf7af3c6c8eef9332be0ee51e58a9055ae0bdc67eb24b57afed8226 SHA512 4721668f3a6db1babe573c90b283eda592bde150928cb33c05826518afb61f3009aa9d556254e78bbd56a1693898629c555e7a74483f920606920ebda0c8522e +EBUILD ioping-1.1.ebuild 626 BLAKE2B d73b3260c038cd61edb707d6fd54024db0620ee1750510b6c020b279f7b5dfbb647fbabbb5a3634fb34a4b5efe4a4e63e1a970c05e9cdd5e6a210c6096ac237b SHA512 5eba185c0b4bf6be4f7fc2499877ab025d886a0dca530cfac5b6e441cf7d9b744b88176b1740d8dc38be61ff5f591e6bd92acd2546f4354eb9b651c0b8e58925 +MISC metadata.xml 559 BLAKE2B b67460679e31d60d569972827b4864035b02ce73e7e9cf2217b1869aee3345e23e54cdddd14d757976dea1e07685f53c16c1f1ac9dbe6c409036fa5beb5559ba SHA512 e9ace78008176fd57af48bf30591d3ce77f95c8b17a3dd25b3bca93c8c762cd80bde191f183f2be5fe800911f2d9f8a094554dfbcbbb0b5c4fc80e17d28931c0 diff --git a/app-benchmarks/ioping/files/ioping-1.1-netdata.patch b/app-benchmarks/ioping/files/ioping-1.1-netdata.patch new file mode 100644 index 000000000000..b93a77e36bbf --- /dev/null +++ b/app-benchmarks/ioping/files/ioping-1.1-netdata.patch @@ -0,0 +1,141 @@ +From 43d15a5f7b4e3f03cb3ae2b4efca9442834e2a98 Mon Sep 17 00:00:00 2001 +From: Vladimir Kobal +Date: Thu, 28 Mar 2019 20:36:20 +0200 +Subject: [PATCH 1/1] Add support for netdata + +--- + ioping.1 | 5 ++++- + ioping.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++-- + 2 files changed, 54 insertions(+), 3 deletions(-) + +diff --git a/ioping.1 b/ioping.1 +index 9c66997..534fc61 100644 +--- a/ioping.1 ++++ b/ioping.1 +@@ -3,7 +3,7 @@ + ioping \- simple disk I/O latency monitoring tool + .SH SYNOPSYS + .SY ioping +-.OP \-ABCDLRWGYykq ++.OP \-ABCDLRWGYykqN + .OP \-c count + .OP \-i interval + .OP \-l speed +@@ -107,6 +107,9 @@ Keep and reuse temporary working file "ioping.tmp" (only for directory target). + .B \-q + Suppress periodical human-readable output. + .TP ++.B \-N ++Use output format compatible with netdata. ++.TP + .B \-h + Display help message and exit. + .TP +diff --git a/ioping.c b/ioping.c +index 1742d96..41790c4 100644 +--- a/ioping.c ++++ b/ioping.c +@@ -327,6 +327,7 @@ void usage(void) + " -y use data sync I/O (O_DSYNC)\n" + " -k keep and reuse temporary file (ioping.tmp)\n" + " -q suppress human-readable output\n" ++ " -N use output format compatible with netdata\n" + " -h display this message and exit\n" + " -v display version and exit\n" + "\n" +@@ -487,6 +488,7 @@ int fd; + void *buf; + + int quiet = 0; ++int netdata_output = 0; + int batch_mode = 0; + int direct = 0; + int cached = 0; +@@ -531,7 +533,7 @@ void parse_options(int argc, char **argv) + exit(1); + } + +- while ((opt = getopt(argc, argv, "hvkALRDCWGYBqyi:t:T:w:s:S:c:o:p:P:l:")) != -1) { ++ while ((opt = getopt(argc, argv, "hvkALRDCWGYBNqyi:t:T:w:s:S:c:o:p:P:l:")) != -1) { + switch (opt) { + case 'h': + usage(); +@@ -608,6 +610,9 @@ void parse_options(int argc, char **argv) + case 'q': + quiet = 1; + break; ++ case 'N': ++ netdata_output = 1; ++ break; + case 'B': + quiet = 1; + batch_mode = 1; +@@ -629,6 +634,19 @@ void parse_options(int argc, char **argv) + if (optind < argc-1) + errx(1, "more than one destination specified"); + path = argv[optind]; ++ ++ if (netdata_output) { ++ if (stop_at_request || custom_deadline || period_request || period_time || custom_deadline || write_read_test) ++ errx(1, "-c, -w, -p, -P, -R, and -G options are incompatible with netdata output (-N)"); ++ ++ if (interval < NSEC_PER_SEC) { ++ interval = NSEC_PER_SEC; ++ warnx("the minimal interval for netdata is 1 second"); ++ } else { ++ interval = roundl(interval / NSEC_PER_SEC) * NSEC_PER_SEC; ++ warnx("round interval to %lld seconds", interval / NSEC_PER_SEC); ++ } ++ } + } + + #ifdef __linux__ +@@ -1152,6 +1170,34 @@ static void dump_statistics(struct statistics *s) { + (unsigned long)s->load_time); + } + ++void print_netdata(ssize_t ret_size, long long time_now, long long this_time) { ++ static int sent_chart = 0; ++ static long long time_prev = 0; ++ ++ fflush(stdout); ++ ++ if (!sent_chart) { ++ printf("CHART 'ioping.%s_", path); ++ print_size(ret_size); ++ printf("_%s_latency' '' '%s Latency for %s' microseconds '%s' ioping.latency line 110030 %lld '' ioping.plugin\n" ++ , write_test ? "write" : "read" ++ , write_test ? "Write" : "Read" ++ , path ++ , path ++ , interval / NSEC_PER_SEC); ++ printf("DIMENSION latency '' absolute 1 1000\n"); ++ sent_chart = 1; ++ } ++ ++ printf("BEGIN 'ioping.%s_", path); ++ print_size(ret_size); ++ printf("_%s_latency' %lld\n", write_test ? "write" : "read", time_prev ? (time_now - time_prev) / 1000 : 0); ++ time_prev = time_now; ++ ++ printf("SET latency %lld\n", this_time); ++ printf("END\n"); ++} ++ + int main (int argc, char **argv) + { + ssize_t ret_size; +@@ -1391,7 +1437,9 @@ skip_preparation: + add_statistics(&part, this_time); + } + +- if (!quiet) { ++ if (netdata_output) { ++ print_netdata(ret_size, time_now, this_time); ++ } else if (!quiet) { + print_size(ret_size); + printf(" %s %s (%s %s", write_test ? ">>>" : "<<<", + path, fstype, device); +-- +2.23.0 + diff --git a/app-benchmarks/ioping/ioping-1.1.ebuild b/app-benchmarks/ioping/ioping-1.1.ebuild new file mode 100644 index 000000000000..a5dbab3ab635 --- /dev/null +++ b/app-benchmarks/ioping/ioping-1.1.ebuild @@ -0,0 +1,30 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit toolchain-funcs + +DESCRIPTION="Simple disk I/0 latency measuring tool" +HOMEPAGE="https://github.com/koct9i/ioping" +SRC_URI="https://github.com/koct9i/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +SLOT="0" +LICENSE="GPL-3" +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux" +IUSE="netdata" + +src_prepare() { + use netdata && eapply "${FILESDIR}/${P}-netdata.patch" + eapply_user +} + +src_configure() { + tc-export CC +} + +src_install() { + emake DESTDIR="${D}" PREFIX="${EPREFIX}/usr" install + + dodoc changelog README.md +} diff --git a/app-benchmarks/ioping/metadata.xml b/app-benchmarks/ioping/metadata.xml index 24e9747fb52f..f1fd644784b8 100644 --- a/app-benchmarks/ioping/metadata.xml +++ b/app-benchmarks/ioping/metadata.xml @@ -12,4 +12,7 @@ ioping koct9i/ioping + + Add support for netdata + -- cgit v1.2.3