Commit Graph

5 Commits

Author SHA1 Message Date
Niels de Vos
b997e0e4d6 Add SupportsMetrics() for Block-mode volumes
Volumes that are provisioned with `VolumeMode: Block` often have a
MetrucsProvider interface declared in their type. However, the
MetricsProvider should implement a GetMetrics() function. In the cases
where the storage drivers do not implement GetMetrics(), a panic can
occur.

Usual type-assertions are not sufficient in this case. All assertions
assume the interface is present. There is no straight forward way to
verify that a valid GetMetrics() function is provided.

By adding SupportsMetrics(), storage driver implementations require
careful reviewing for metrics support.
2021-05-20 17:10:23 +02:00
Angus Salkeld
a1b2fcb10f Disambiguate unsupported metrics from metrics errors 2016-09-15 10:05:30 +10:00
David McMahon
ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
Paul Morie
6415c2d288 Wrap more comments in pkg/volume 2016-06-04 14:14:00 -04:00
Phillip Wittrock
c67ce887f2 Volume Metrics Interface and base implementation.
- Add volume.MetricsProvider function to Volume interface.
- Add volume.MetricsDu for providing metrics via executing "du".
- Add volulme.MetricsNil for unsupported Volumes.
2015-12-09 16:06:24 -08:00