summaryrefslogtreecommitdiff
path: root/src/mongo/util/procparser.h
diff options
context:
space:
mode:
authorMark Benvenuto <mark.benvenuto@mongodb.com>2016-07-14 15:36:32 -0400
committerMark Benvenuto <mark.benvenuto@mongodb.com>2016-07-14 15:52:50 -0400
commit132de7f6e3270321fbbd072c06b05691cbb8baa8 (patch)
tree4c09cc830d9776a68e1697e3b42892f019972e7f /src/mongo/util/procparser.h
parentb602fbbe46fa4e09cc488428acfd963771f7ebff (diff)
downloadmongo-132de7f6e3270321fbbd072c06b05691cbb8baa8.tar.gz
SERVER-24606 Add support for collecting information from /proc/diskstats
Diffstat (limited to 'src/mongo/util/procparser.h')
-rw-r--r--src/mongo/util/procparser.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/mongo/util/procparser.h b/src/mongo/util/procparser.h
index ed18b8bd197..2f9e97e343c 100644
--- a/src/mongo/util/procparser.h
+++ b/src/mongo/util/procparser.h
@@ -87,5 +87,34 @@ Status parseProcMemInfoFile(StringData filename,
const std::vector<StringData>& keys,
BSONObjBuilder* builder);
+/**
+ * Read a string matching /proc/diskstats format, and write the specified list of disks in builder.
+ *
+ * disks - vector of block devices to include in output. For each disk selected, 11 fields are
+ * output in a nested document. There is no error if the disk is not found in the data. Also
+ * a disk is excluded if it has no activity since startup (i.e. an idle CD-ROM drive). If
+ * disks is empty, all non-zero block devices are outputed (this will include partitions,
+ * etc).
+ * data - string to parsee
+ * builder - BSON output
+ */
+Status parseProcDiskStats(const std::vector<StringData>& disks,
+ StringData data,
+ BSONObjBuilder* builder);
+
+/**
+ * Read from file, and write the specified list of disks in builder.
+ */
+Status parseProcDiskStatsFile(StringData filename,
+ const std::vector<StringData>& disks,
+ BSONObjBuilder* builder);
+
+/**
+ * Get a vector of disks to monitor by enumerating the specified directory.
+ *
+ * If the directory does not exist, or otherwise permission is denied, returns an empty vector.
+ */
+std::vector<std::string> findPhysicalDisks(StringData directory);
+
} // namespace procparser
} // namespace mongo