Bug 212726 - [patch][gstat] Add blocks' size to stastistics and add -B for continuous batch mode
Summary: [patch][gstat] Add blocks' size to stastistics and add -B for continuous batc...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: Marcelo Araujo
URL:
Keywords: patch
: 198347 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-09-16 12:24 UTC by Ben RUBSON
Modified: 2016-11-25 05:54 UTC (History)
4 users (show)

See Also:


Attachments
Add blocks' size to gstat (4.17 KB, patch)
2016-09-16 12:24 UTC, Ben RUBSON
no flags Details | Diff
Add blocks' size to gstat (4.04 KB, patch)
2016-09-16 14:18 UTC, Ben RUBSON
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ben RUBSON 2016-09-16 12:24:34 UTC
Created attachment 174827 [details]
Add blocks' size to gstat

Hello,

Here is a patch to add blocks' size to gstat statistics.
It then add a new -s option which enables this feature.

Blocks' size are important to analyse and understand storage performance.

This patch also includes the continuous batch flag (-B) introduced there :
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=198347

Could we then merge this small patch please ?

Thank you very much !

Ben
Comment 1 Ben RUBSON 2016-09-16 14:18:20 UTC
Created attachment 174833 [details]
Add blocks' size to gstat

Correct fflush(stdout) with -B flag.
Comment 2 Ben RUBSON 2016-09-16 14:52:17 UTC
This patch is needed for the following new OpenTSDB collector :
https://github.com/OpenTSDB/tcollector/pull/344

Thank you for your help !

Ben
Comment 3 Kurt Jaeger freebsd_committer freebsd_triage 2016-09-17 06:21:07 UTC
Testbuilds on current are fine
Comment 4 Kurt Jaeger freebsd_committer freebsd_triage 2016-09-17 06:21:19 UTC
run-tests are fine, too, btw.
Comment 5 Ben RUBSON 2016-11-08 07:10:50 UTC
Could we think about merging this please ?
Is everything OK ?
Many thanks !
Comment 6 Marcelo Araujo freebsd_committer freebsd_triage 2016-11-09 04:44:06 UTC
Take this PR by submitter requires.
Comment 7 Marcelo Araujo freebsd_committer freebsd_triage 2016-11-09 05:07:17 UTC
*** Bug 198347 has been marked as a duplicate of this bug. ***
Comment 8 commit-hook freebsd_committer freebsd_triage 2016-11-09 07:32:28 UTC
A commit references this bug:

Author: araujo
Date: Wed Nov  9 07:31:39 UTC 2016
New revision: 308462
URL: https://svnweb.freebsd.org/changeset/base/308462

Log:
  Add flag -B which does the same like batch mode but without exiting after
  print. Also add a new flag -s that add blocks size to statistics.

  PR:		198347, 212726
  Submitted by:	Ben RUBSON <ben.rubson@gmail.com>
  Tested by:	pi
  MFC After:	2 weeks.

Changes:
  head/usr.sbin/gstat/gstat.8
  head/usr.sbin/gstat/gstat.c
Comment 9 Ben RUBSON 2016-11-09 07:33:37 UTC
Marcelo, thank you very much !!
Comment 10 Marcelo Araujo freebsd_committer freebsd_triage 2016-11-09 07:34:14 UTC
Thanks for the patch!
Feel free to ping me again if needed.
I made few modifications that were missed, as an example the usage() function:
root@pipoca:/usr/src/usr.sbin/gstat # gstat -h
gstat: illegal option -- h
usage: gstat [-abBcdps] [-f filter] [-I interval]


Br,
Comment 11 commit-hook freebsd_committer freebsd_triage 2016-11-25 05:54:49 UTC
A commit references this bug:

Author: araujo
Date: Fri Nov 25 05:54:18 UTC 2016
New revision: 309130
URL: https://svnweb.freebsd.org/changeset/base/309130

Log:
  MFC r308443, r308459, r308462, r308478, r308786

  r308443:
  Add -d flag that prints domain only.

  PR:		212875
  Submitted by:	Ben RUBSON <ben.rubson@gmail.com>
  Reviewed by:	pi

  r308459:
  Fix missing '-' for the flags -s and -d on both manpage and usage.

  Reported by:	garga, bde

  r308462:
  Add flag -B which does the same like batch mode but without exiting after
  print. Also add a new flag -s that add blocks size to statistics.

  PR:		198347, 212726
  Submitted by:	Ben RUBSON <ben.rubson@gmail.com>
  Tested by:	pi
  MFC After:	2 weeks.

  r308478:
  We can't use protect(1) inside a jail(8)!
  To avoid have warning for services that are using oomprotect, oomprotect
  will only be applied on services that won't run inside jails.

  Reported by:	allanjude
  MFC after:	2 weeks.

  r308786:
  rc.subr: Swap checks so we only fork sysctl if *_oomprotect is set.

Changes:
_U  stable/11/
  stable/11/bin/hostname/hostname.1
  stable/11/bin/hostname/hostname.c
  stable/11/etc/rc.subr
  stable/11/usr.sbin/gstat/gstat.8
  stable/11/usr.sbin/gstat/gstat.c