search for: print_stat

Displaying 20 results from an estimated 34 matches for "print_stat".

2019 Nov 30
4
[PATCH nbdkit v2 0/3] filters: stats: More useful, more friendly
...for flush I hope that these changes will help to understand and improve virt-v2v performance. Changes since v1: - Keep bytes values - Increase precision to 0.001 GiB and 0.001 MiB/s - Add total stats - Show time before size/rate for more consistent format - Streamline using new record_stat() and print_stat() v1 was here: https://www.redhat.com/archives/libguestfs/2019-November/msg00345.html Nir Soffer (3): filters: stats: Add size in GiB, show rate in MiB/s filters: stats: Measure time per operation filters: stats: Add flush stats filters/stats/stats.c | 108 ++++++++++++++++++++++++++++++++...
2019 Nov 30
0
[PATCH nbdkit v2 2/3] filters: stats: Measure time per operation
...ilters/stats/stats.c +++ b/filters/stats/stats.c @@ -62,6 +62,7 @@ typedef struct { const char *name; uint64_t ops; uint64_t bytes; + uint64_t usecs; } stat; /* This lock protects all the stats. */ @@ -80,28 +81,42 @@ calc_rate (uint64_t bytes, int64_t usecs) } static inline void -print_stat (const stat *st, int64_t usecs) +print_stat (const stat *st) { if (st->ops > 0) - fprintf (fp, "%s: %" PRIu64 " ops, %" PRIu64 " bytes, %.3f GiB, %.3f MiB/s\n", + fprintf (fp, "%s: %" PRIu64 " ops, %.3f s, %" PRIu64 " bytes, %.3...
2019 Dec 04
6
[PATCH nbdkit v3 0/5] filters: stats: More useful, more friendly
This is the third attempt to make the stats filter better. This time I kept the changes minimal to make it eaier to make progress. I tried the idea of showing global stats in separate "total" section, but it became messy and hard to implemnt, so I tried the simpler solution of showing both operation rate and total rate in the operation line. Nir Soffer (5): filters: stats: Add
2019 Nov 30
0
[PATCH nbdkit v2 1/3] filters: stats: Add size in GiB, show rate in MiB/s
...ts_st = { "extents" }; static stat cache_st = { "cache" }; static inline double -calc_bps (uint64_t bytes, int64_t usecs) +calc_rate (uint64_t bytes, int64_t usecs) { - return 8.0 * bytes / usecs * 1000000.; + return bytes / MiB / usecs * USEC; } static inline void print_stat (const stat *st, int64_t usecs) { if (st->ops > 0) - fprintf (fp, "%s: %" PRIu64 " ops, %" PRIu64 " bytes, %g bits/s\n", - st->name, st->ops, st->bytes, calc_bps (st->bytes, usecs)); + fprintf (fp, "%s: %" PRIu64 "...
2019 Nov 30
0
[PATCH nbdkit v2 3/3] filters: stats: Add flush stats
...static stat extents_st = { "extents" }; static stat cache_st = { "cache" }; +static stat flush_st = { "flush" }; static inline double calc_rate (uint64_t bytes, int64_t usecs) @@ -83,14 +84,20 @@ calc_rate (uint64_t bytes, int64_t usecs) static inline void print_stat (const stat *st) { - if (st->ops > 0) - fprintf (fp, "%s: %" PRIu64 " ops, %.3f s, %" PRIu64 " bytes, %.3f GiB, %.3f MiB/s\n", + if (st->ops > 0) { + fprintf (fp, "%s: %" PRIu64 " ops, %.3f s", st->name,...
2019 Dec 04
0
[PATCH nbdkit v3 5/5] filters: stats: Show total stats
...00 GiB, 3968.25 GiB/s op, 798.13 MiB/s total flush: 9 ops, 0.000002 s, 0 bytes, 0 bytes/s op, 0 bytes/s total =head1 PARAMETERS diff --git a/filters/stats/stats.c b/filters/stats/stats.c index fbd6b87..0759ceb 100644 --- a/filters/stats/stats.c +++ b/filters/stats/stats.c @@ -125,10 +125,27 @@ print_stat (const stat *st, int64_t usecs) } } +static void +print_totals (uint64_t usecs) +{ + uint64_t ops = pread_st.ops + pwrite_st.ops + trim_st.ops + zero_st.ops + + extents_st.ops + flush_st.ops; + uint64_t bytes = pread_st.bytes + pwrite_st.bytes + trim_st.bytes + + zero_st.bytes; + cha...
2017 Dec 12
2
[PATCH] df: Handle block sizes smaller than 1024 bytes (RHBZ#1525241).
...+ * scale (n, 512, 1024) ==> n / 2 + */ +static uintmax_t +scale (uintmax_t n, uintmax_t from, uintmax_t to) +{ + if (from >= to) { + uintmax_t multiplier = from / to; + return n * multiplier; + } + else { + uintmax_t divisor = to / from; + return n / divisor; + } +} + void print_stat (FILE *fp, const char *name, const char *uuid_param, @@ -95,7 +111,7 @@ print_stat (FILE *fp, #define MAX_LEN (LONGEST_HUMAN_READABLE > 128 ? LONGEST_HUMAN_READABLE : 128) char buf[4][MAX_LEN]; const char *cols[4]; - int64_t factor, v; + int64_t v; float percent; cons...
2004 Nov 16
0
metadata switches for ffmpeg2theora
...){ + ogg_stream_packetin (&info->vo, &info->op); } } - info.audioflag=1; + info->audioflag=1; /* - if (ogg_stream_eos (&info.vo)){ - info.audioflag = 0; + if (ogg_stream_eos (&info->vo)){ + info->audioflag = 0; return 0; } */ return 0; } -void print_stats(double timebase){ +static void print_stats(theoraframes_info *info, double timebase){ int hundredths = timebase * 100 - (long) timebase * 100; int seconds = (long) timebase % 60; int minutes = ((long) timebase / 60) % 60; int hours = (long) timebase / 3600; - if(info.vkbps<0) - info....
2014 Jun 19
3
Problems in flac-website Git files.
1) changelog.html "Add ability to handle utf8 filenames on Windows (large set of patches from Janne Hyv?rinen)" AFAIK Windows internally uses UTF-16LE, not UTF-8. IMHO it's better to use a general word 'Unicode' instead of 'utf8'. 2) documentation_bugs.html "The following are major known bugs in the current (1.2.1) release:" 1.2.1 is not the current
2019 Nov 30
5
[PATCH nbdkit 0/3] filters: stats: More useful, more friendly
- Use more friendly output with GiB and MiB/s. - Measure time per operation, providing finer grain stats - Add missing stats for flush I hope that these changes will help to understand and imporve virt-v2v performance. Nir Soffer (3): filters: stats: Show size in GiB, rate in MiB/s filters: stats: Measure time per operation filters: stats: Add flush stats filters/stats/stats.c | 117
2012 Nov 14
1
Notes on compiling libguestfs 1.19.59 on Debian 7 (Wheezy) beta
In no particular order. Some of these need further investigation. ---------------------------------------------------------------------- I had to patch libguestfs not to use febootstrap-supermin-helper --copy-kernel option. See attachment #1. This could be avoided by providing a newer febootstrap in Wheezy. I had to patch libguestfs to make it not use the (not working) virtio-scsi in old
2011 Jun 21
13
VM disk I/O limit patch
...kif); static int dispatch_rw_block_io(blkif_t *blkif, blkif_request_t *req, - pending_req_t *pending_req); + pending_req_t *pending_req, + int *done_nr_sects); static void make_response(blkif_t *blkif, u64 id, unsigned short op, int st); @@ -206,10 +212,20 @@ static void print_stats(blkif_t *blkif) blkif->st_pk_req = 0; } +static void refill_reqcount(blkif_t *blkif) +{ + blkif->reqtime = jiffies + msecs_to_jiffies(1000); + blkif->reqcount = blkif->reqrate; + if (blkif->reqcount < blkif->reqmin) + blkif->reqcount = blkif->reqmin; +} + int b...
2011 Jun 21
13
VM disk I/O limit patch
...kif); static int dispatch_rw_block_io(blkif_t *blkif, blkif_request_t *req, - pending_req_t *pending_req); + pending_req_t *pending_req, + int *done_nr_sects); static void make_response(blkif_t *blkif, u64 id, unsigned short op, int st); @@ -206,10 +212,20 @@ static void print_stats(blkif_t *blkif) blkif->st_pk_req = 0; } +static void refill_reqcount(blkif_t *blkif) +{ + blkif->reqtime = jiffies + msecs_to_jiffies(1000); + blkif->reqcount = blkif->reqrate; + if (blkif->reqcount < blkif->reqmin) + blkif->reqcount = blkif->reqmin; +} + int b...
2006 May 11
2
C++ Set_Metadata Problem
I refer to a problem that appeared on the flac list last August that was either solved off-list or abandoned. (http://lists.xiph.org/pipermail/flac/2005-August/000468.html) The problem is with using the C++ encoder classes, particularly the FLAC::Encoder::File:set_metadata function. JC said that the developers version of how to add a simple metadata block looked right, but it did not work for
2019 Nov 30
1
Re: [PATCH nbdkit 2/3] filters: stats: Measure time per operation
> > The rest of the code is screaming out to be refactored so we aren't > > repeating the same change over and over. How about using something > > like the attached patch as an initial refactoring? > > Very nice, do you want to push it? I can include it in v2. Yes I'll push it now. Will think about the rest of your email later! Rich. -- Richard Jones,
2019 Nov 30
0
[PATCH nbdkit 1/3] filters: stats: Show size in GiB, rate in MiB/s
...ic uint64_t extents_ops, extents_bytes; static uint64_t cache_ops, cache_bytes; static inline double -calc_bps (uint64_t bytes, int64_t usecs) +calc_mibps (uint64_t bytes, int64_t usecs) { - return 8.0 * bytes / usecs * 1000000.; + return bytes / MiB / usecs * USEC; } static inline void print_stats (int64_t usecs) { - fprintf (fp, "elapsed time: %g s\n", usecs / 1000000.); + fprintf (fp, "elapsed time: %.3f s\n", usecs / USEC); if (pread_ops > 0) - fprintf (fp, "read: %" PRIu64 " ops, %" PRIu64 " bytes, %g bits/s\n", -...
2007 Jan 11
0
[PATCH 6/8] HVM save restore: guest memory handling
...); +} + + +#define RATE_IS_MAX() (0) +#define ratewrite(_io_fd, _buf, _n) write((_io_fd), (_buf), (_n)) +#define initialize_mbit_rate() + +static inline ssize_t write_exact(int fd, void *buf, size_t count) +{ + if(write(fd, buf, count) != count) + return 0; + return 1; +} + +static int print_stats(int xc_handle, uint32_t domid, int pages_sent, + xc_shadow_op_stats_t *stats, int print) +{ + static struct timeval wall_last; + static long long d0_cpu_last; + static long long d1_cpu_last; + + struct timeval wall_now; + long long...
2007 Feb 02
1
Bug#409355: xen-utils-common: please make width of hostname column in xentop wider
...+0100 @@ -144,7 +144,7 @@ } field; field fields[] = { - { FIELD_NAME, "NAME", 10, compare_name, print_name }, + { FIELD_NAME, "NAME", 20, compare_name, print_name }, { FIELD_STATE, "STATE", 6, compare_state, print_state }, { FIELD_CPU, "CPU(sec)", 10, compare_cpu, print_cpu }, { FIELD_CPU_PCT, "CPU(%)", 6, compare_cpu_pct, print_cpu_pct }, -- System Information: Debian Release: 4.0 APT prefers testing APT policy: (500, 'testing') Architecture: a...
2019 Dec 03
2
[PATCH nbdkit] filters: stats: Show size and rate in human size
...iB", bytes / (double)KiB); + else if (bytes < GiB) + snprintf (buf, sizeof(buf), "%.2f MiB", bytes / (double)MiB); + else + snprintf (buf, sizeof(buf), "%.2f GiB", bytes / (double)GiB); + + return strdup(buf); } -static inline void +static void print_stat (const stat *st, int64_t usecs) { - if (st->ops > 0) - fprintf (fp, "%s: %" PRIu64 " ops, %" PRIu64 " bytes, %g bits/s\n", - st->name, st->ops, st->bytes, calc_bps (st->bytes, usecs)); + if (st->ops > 0) { + char *size = hum...
2019 Nov 30
0
[PATCH nbdkit 2/3] filters: stats: Measure time per operation
...tic uint64_t trim_ops, trim_bytes, trim_usecs; +static uint64_t zero_ops, zero_bytes, zero_usecs; +static uint64_t extents_ops, extents_bytes, extents_usecs; +static uint64_t cache_ops, cache_bytes, cache_usecs; static inline double calc_mibps (uint64_t bytes, int64_t usecs) @@ -79,23 +79,23 @@ print_stats (int64_t usecs) fprintf (fp, "elapsed time: %.3f s\n", usecs / USEC); if (pread_ops > 0) - fprintf (fp, "read: %" PRIu64 " ops, %.2f GiB, %.2f MiB/s\n", - pread_ops, pread_bytes / GiB, calc_mibps (pread_bytes, usecs)); + fprintf (fp, &quot...