nfs: log number of chunks that xfer'd a file

pull/2793/head
Victor Julien 8 years ago
parent ed706583e9
commit 7c119cc595

@ -74,6 +74,7 @@ fn nfs_file_object(tx: &NFSTransaction) -> Json
};
js.set_integer("last_xid", tdf.file_last_xid as u64);
js.set_integer("chunks", tdf.chunk_count as u64);
return js;
}
/*

@ -103,6 +103,8 @@ pub struct NFSTransactionFile {
/// only COMMIT on WRITEs.
pub file_additional_procs: Vec<u32>,
pub chunk_count: u32,
/// last xid of this file transfer. Last READ or COMMIT normally.
pub file_last_xid: u32,
@ -115,6 +117,7 @@ impl NFSTransactionFile {
pub fn new() -> NFSTransactionFile {
return NFSTransactionFile {
file_additional_procs: Vec::new(),
chunk_count:0,
file_last_xid: 0,
file_tracker: FileTransferTracker::new(),
}
@ -571,9 +574,11 @@ impl NFSState {
Some(NFSTransactionTypeData::FILE(ref mut d)) => d,
_ => panic!("BUG"),
};
tdf.chunk_count += 1;
tdf.file_additional_procs.push(NFSPROC3_COMMIT);
tdf.file_tracker.close(files, flags);
tdf.file_last_xid = r.hdr.xid;
tx.is_last = true;
tx.request_done = true;
},
None => { },
@ -782,6 +787,7 @@ impl NFSState {
filetracker_newchunk(&mut tdf.file_tracker, files, flags,
&file_name, w.file_data, w.offset,
w.file_len, fill_bytes as u8, is_last, &r.hdr.xid);
tdf.chunk_count += 1;
if is_last {
tdf.file_last_xid = r.hdr.xid;
tx.is_last = true;
@ -1089,6 +1095,7 @@ impl NFSState {
}
}
tdf.chunk_count += 1;
let cs = tdf.file_tracker.update(files, flags, data, gap_size);
cs
},
@ -1160,6 +1167,7 @@ impl NFSState {
filetracker_newchunk(&mut tdf.file_tracker, files, flags,
&file_name, reply.data, chunk_offset,
reply.count, fill_bytes as u8, reply.eof, &r.hdr.xid);
tdf.chunk_count += 1;
if is_last {
tdf.file_last_xid = r.hdr.xid;
tx.rpc_response_status = r.reply_state;

Loading…
Cancel
Save