void on_rpc_free()

in turbonfs/inc/rpc_stats.h [217:270]


    void on_rpc_free()
    {
        /*
         * stamp.issue won't be set for requests which were not sent to
         * the server. Most likely reason is that the request was served from
         * the cache.
         * stamp.complete won't be set (while stamp.issue is set) for
         * requests which don't get a response. Even those we don't count for
         * stats.
         */
        if (stamp.issue != 0 && stamp.complete != 0) {
            assert(stamp.complete > stamp.dispatch);
            assert(stamp.dispatch >= stamp.issue);

            stamp.free = get_current_usecs();

            assert(optype > 0 && optype <= FUSE_OPCODE_MAX);
            opstats[optype].count++;
            opstats[optype].bytes_sent += req_size;
            opstats[optype].bytes_rcvd += resp_size;

            opstats[optype].rtt_usec += (stamp.complete - stamp.dispatch);
            opstats[optype].dispatch_usec += (stamp.dispatch - stamp.issue);
            opstats[optype].total_usec += (stamp.complete - stamp.start);
        } else if (stamp.issue == 0) {
            /*
             * Requests not issued.
             * See skip_mtime_update() for how we can come here for
             * FUSE_SETATTR.
             *
             * Note: FUSE_FLUSH is never issued as an RPC to the server,
             *       so all FUSE_FLUSH tasks come here.
             */
            assert(stamp.dispatch == 0);
            assert(stamp.complete == 0);
            assert(optype == FUSE_READDIR ||
                   optype == FUSE_READDIRPLUS ||
                   optype == FUSE_READ ||
                   optype == FUSE_WRITE ||
                   optype == FUSE_FLUSH ||
                   optype == FUSE_GETATTR ||
                   optype == FUSE_LOOKUP ||
                   optype == FUSE_SETATTR);
        } else {
            /*
             * Requests issued but not completed.
             */
            assert(stamp.issue != 0);
            assert(stamp.dispatch == 0);
            assert(stamp.complete == 0);

            AZLogWarn("Didn't get response for RPC request type {}", (int) optype);
        }
    }