Commit 729fd22a authored by Andrew Mitchell's avatar Andrew Mitchell
Browse files

Added support for Limit reporting in GetLog

parent 93a7e67b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -65,8 +65,8 @@ ExternalProject_add(
    INSTALL_COMMAND ""
)

set(KINETIC_PROTO_VERSION "2.0.0")
set(KINETIC_PROTO_MD5 "10d4090be4315644874bf80b3e9ff748")
set(KINETIC_PROTO_VERSION "6dcceb871d03ae8b727d48ddcc88053d9e9d6874")
set(KINETIC_PROTO_MD5 "de61424f3340a6216a3576c1997f2f2c")

ExternalProject_add(
    kinetic-proto
+13 −0
Original line number Diff line number Diff line
@@ -60,12 +60,25 @@ typedef struct {
    std::string source_hash;
} Configuration;

typedef struct {
    uint32_t max_key_size;
    uint32_t max_value_size;
    uint32_t max_version_size;
    uint32_t max_tag_size;
    uint32_t max_connections;
    uint32_t max_outstanding_read_requests;
    uint32_t max_outstanding_write_requests;
    uint32_t max_message_size;
} Limits;


typedef struct {
    Configuration configuration;
    Capacity capacity;
    std::list<OperationStatistic> operation_statistics;
    std::list<Utilization> utilizations;
    std::list<Temperature> temperatures;
    Limits limits;
    std::string messages;
} DriveLog;

+12 −0
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@ using com::seagate::kinetic::client::proto::Message_GetLog_Type_CAPACITIES;
using com::seagate::kinetic::client::proto::Message_GetLog_Type_CONFIGURATION;
using com::seagate::kinetic::client::proto::Message_GetLog_Type_STATISTICS;
using com::seagate::kinetic::client::proto::Message_GetLog_Type_MESSAGES;
using com::seagate::kinetic::client::proto::Message_GetLog_Type_LIMITS;
using com::seagate::kinetic::client::proto::Message_Security_ACL;
using com::seagate::kinetic::client::proto::Message_Security_ACL_Permission;
using com::seagate::kinetic::client::proto::Message_Security_ACL_Scope;
@@ -150,6 +151,16 @@ void GetLogHandler::Handle(const Message& response, unique_ptr<const string> val
    drive_log->capacity.remaining_bytes = capacity.remaining();
    drive_log->capacity.total_bytes = capacity.total();

    auto limits = getlog.limits();
    drive_log->limits.max_key_size = limits.maxkeysize();
    drive_log->limits.max_value_size = limits.maxvaluesize();
    drive_log->limits.max_version_size = limits.maxversionsize();
    drive_log->limits.max_tag_size = limits.maxtagsize();
    drive_log->limits.max_connections = limits.maxconnections();
    drive_log->limits.max_outstanding_read_requests = limits.maxoutstandingreadrequests();
    drive_log->limits.max_outstanding_write_requests = limits.maxoutstandingwriterequests();
    drive_log->limits.max_message_size = limits.maxmessagesize();

    for (int i = 0; i < getlog.statistics_size(); i++) {
        OperationStatistic statistic;
        statistic.name = Message_MessageType_Name(getlog.statistics(i).messagetype());
@@ -410,6 +421,7 @@ HandlerKey NonblockingKineticConnection::GetLog(
    mutable_getlog->add_type(Message_GetLog_Type_CONFIGURATION);
    mutable_getlog->add_type(Message_GetLog_Type_STATISTICS);
    mutable_getlog->add_type(Message_GetLog_Type_MESSAGES);
    mutable_getlog->add_type(Message_GetLog_Type_LIMITS);

    unique_ptr<GetLogHandler> handler(new GetLogHandler(callback));
    return service_->Submit(move(request), empty_str_, move(handler));