diff options
author | Richard Wareing <rwareing@fb.com> | 2015-06-23 17:03:11 -0700 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2015-11-01 09:14:34 -0800 |
commit | d3e496cbcd35b9d9b840e328ae109c44f59083ce (patch) | |
tree | 25eedba238f9168cd11015885973d5a960c1596e /libglusterfs/src/common-utils.h | |
parent | 846697d91ed56ca3d76f2a78e87e7675f127f21d (diff) |
debug/io-stats: Add FOP sampling feature
Summary:
- Using sampling feature you can record details about every Nth FOP.
The fields in each sample are: FOP type, hostname, uid, gid, FOP priority,
port and time taken (latency) to fufill the request.
- Implemented using a ring buffer which is not (m/c) allocated in the IO path,
this should make the sampling process pretty cheap.
- DNS resolution done @ dump time not @ sample time for performance w/
cache
- Metrics can be used for both diagnostics, traffic/IO profiling as well
as P95/P99 calculations
- To control this feature there are two new volume options:
diagnostics.fop-sample-interval - The sampling interval, e.g. 1 means
sample every FOP, 100 means sample every 100th FOP
diagnostics.fop-sample-buf-size - The size (in bytes) of the ring
buffer used to store the samples. In the even more samples
are collected in the stats dump interval than can be held in this buffer,
the oldest samples shall be discarded. Samples are stored in the log
directory under /var/log/glusterfs/samples.
- Uses DNS cache written by sshreyas@fb.com (Thank-you!), the DNS cache
TTL is controlled by the diagnostics.stats-dnscache-ttl-sec option
and defaults to 24hrs.
Test Plan:
- Valgrind'd to ensure it's leak free
- Run prove test(s)
- Shadow testing on 100+ brick cluster
Change-Id: I9ee14c2fa18486b7efb38e59f70687249d3f96d8
BUG: 1271310
Signed-off-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-on: http://review.gluster.org/12210
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'libglusterfs/src/common-utils.h')
-rw-r--r-- | libglusterfs/src/common-utils.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/libglusterfs/src/common-utils.h b/libglusterfs/src/common-utils.h index 77a8cdd51c7..bf574fdabc7 100644 --- a/libglusterfs/src/common-utils.h +++ b/libglusterfs/src/common-utils.h @@ -159,6 +159,27 @@ typedef struct dht_changelog_rename_info { typedef int (*gf_cmp) (void *, void *); +struct _dict; + +struct dnscache { + struct _dict *cache_dict; + time_t ttl; +}; + +struct dnscache_entry { + char *ip; + char *fqdn; + time_t timestamp; +}; + + +struct dnscache *gf_dnscache_init (time_t ttl); +struct dnscache_entry *gf_dnscache_entry_init (); +void gf_dnscache_entry_deinit (struct dnscache_entry *entry); +char *gf_rev_dns_lookup_cached (const char *ip, struct dnscache *dnscache); + +char *gf_resolve_path_parent (const char *path); + void gf_global_variable_init(void); int32_t gf_resolve_ip6 (const char *hostname, uint16_t port, int family, |