| // Copyright 2019 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| @available(added=7) |
| library fuchsia.storage.metrics; |
| |
| /// Stats for calls. These stats track completed calls - they may or may not have |
| /// succeeded. Unless specified otherwise , time units are in nanoseconds and |
| /// data transferred is in bytes |
| @for_deprecated_c_bindings |
| type CallStatRaw = struct { |
| /// Minimum time taken by a request to be served. |
| minimum_latency uint64; |
| |
| /// Maximum time taken by a request to be served. |
| maximum_latency uint64; |
| |
| /// Total time spent to serve requests. |
| total_time_spent uint64; |
| |
| /// Total number of calls. |
| total_calls uint64; |
| |
| /// byte_transferred may mean different things in different context. For |
| /// example, read and write may use it for bytes read/written, whereas |
| /// create/lseek may use bytes_transferred for file name length or number |
| /// of bytes lseek-ed from current position. |
| /// bytes_transferred has special meaning if the succeeded or failed. |
| /// On success: |
| /// Partitally succeeded calls, bytes fetched is less than bytes requested, |
| /// can be considered as successful. To keep latency and time_spent numbers |
| /// accurate, on success, bytes transferred is number bytes returned to |
| /// caller. It is NOT the number of bytes fetched from underlying subsystem |
| /// and it is NOT number of bytes requested by the caller. |
| /// On failure: |
| /// On failure, bytes_transferred is the number of bytes requested by the |
| /// caller. |
| bytes_transferred uint64; |
| }; |
| |
| @for_deprecated_c_bindings |
| type CallStat = struct { |
| /// CallStat keeps track of the successful commands and failed commands |
| /// seperately as successful commands may generate completely different stats |
| /// than failed commands - a write() to read-only file handle may fail |
| /// in nanoseconds and if the stats tracked together, it will skew the |
| /// numbers. |
| success CallStatRaw; |
| failure CallStatRaw; |
| }; |
| |
| @for_deprecated_c_bindings |
| type FsMetrics = struct { |
| /// Call stats for create |
| create CallStat; |
| |
| /// Call stats for read |
| read CallStat; |
| |
| /// Call stats for write |
| write CallStat; |
| |
| /// Call stats for truncate |
| truncate CallStat; |
| |
| /// Call stats for unlink |
| unlink CallStat; |
| |
| /// Call stats for rename |
| rename CallStat; |
| |
| /// Call stats for directory lookups |
| lookup CallStat; |
| |
| /// Call stats for open. This may or may |
| /// not include directory lookup during open |
| open CallStat; |
| }; |