Skip to content

Protobuf client interface: Add read/write and other statistics #1237

@uweseimet

Description

@uweseimet

The piscsi core shall remember the number of read/write accesses, how often there was a cache miss, and how often there was an I/O error when accessing the image file or image block device. A new remote interface operation STATISTICS_INFO shall be added. This method shall be extensible, so that other information can be added (backwards comptible) if need should be. The statistics shall be categorized by an enum denoting the severity, e.g. INFO, ERROR.
For consistency the data returned by this method shall also be returned by the GET_SERVER_INFO method.

scsictl shall be extended with statistics support, using option '-S'.

Depending on the category a client like the PiSCSI Control app might generate an alert notification and/or send an email. Such a client should remember any action taken, so that for the same error condition there is only one notification.

Suggested protobuf interface:

enum PbOperation {
  ...
  // Get statistics (PbStatisticsInfo)
  STATISTICS_INFO = 32;
}

enum PbStatisticsCategory {
  CATEGORY_NONE = 0;
  CATEGORY_INFO = 1;
  CATEGORY_WARNING = 2;
  CATEGORY_ERROR = 3;
}

message PbStatistics {
    PbStatisticsCategory category = 1;
    // The device ID and LUN for this statistics item. Both are -1 if the item is not device specific.
    int32 id = 2;
    int32 unit = 3;
    // A symbolic unique item name, may be used for I18N. Supported values and their categories
    string key = 4;
    uint64 value = 5;
}

message PbStatisticsInfo {
  repeated PbStatistics statistics = 1;
}

message PbServerInfo {
  ...
  PbStatisticsInfo statistics_info = 10;
}

message PbResult {
  ...
  // The result of a STATISTICS_INFO command
  PbStatisticsInfo statistics_info = 15;
}

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions