本文整理汇总了C++中Stat::Record方法的典型用法代码示例。如果您正苦于以下问题:C++ Stat::Record方法的具体用法?C++ Stat::Record怎么用?C++ Stat::Record使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Stat
的用法示例。
在下文中一共展示了Stat::Record方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: print_stats
void PIOS::print_stats(run_arg *args)
{
char regionstr[32], chunkstr[32], mbstr[32];
cfs_duration_t highest, lowest, average;
__u64 agvsize;
Stat *st = args->st;
assert(st != NULL);
st->Record("%d\t%s\t%llu\t%d\t%llu\t%s\t%s\t",
args->runno,
args->verify ? "Read" : "Write",
args->startime,
args->threadcount,
args->regioncount,
in_MBs(regionstr, args->regionsize),
in_MBs(chunkstr, args->chunksize));
/* TODO: chunk noise */
assert(args->chunknoise == 0);
agvsize = args->regionsize * args->regioncount;
find_high_low_duration(args, &highest, &lowest, &average);
in_MBs(mbstr, agvsize * params.TimeUnit / args->iotime);
st->Record("%s/s\t\t%2.3fs\t%2.3fs\t%2.3fs\n",
mbstr,
((double)(lowest / 1000000)) / 1000.0,
((double)(highest / 1000000)) / 1000.0,
((double)(args->iotime / 1000000)) / 1000.0);
}
示例2: Run
void PIOS::Run()
{
struct pios_params params;
struct run_arg args;
int runno = 0;
Stat *st;
__u32 T;
__u64 C;
__u64 O;
__u64 S;
__u64 N;
memset(¶ms, 0, sizeof(params));
params.factor = 2;
params.fpp = 1;
params.C[0] = /*8 * 1048576; //*/512 * 1024;
params.C[1] = /*8 * 1048576; //*/512 * 1024;
params.O[0] = 8 * 1048576;
params.O[1] = 8 * 1048576;
params.S[0] = 8 * 1048576;
params.S[1] = 8 * 1048576;
params.N[0] = 1;
params.N[1] = 128;
params.T[0] = 1;
params.T[1] = 16;
st = new Stat(/*"pios.res"*/stdout);
st->Record("Run\tTest\tTstamp\t\tT\tN\tS\tC\t%s"
"Aggregate\tLowest\tHighest\tRun_time\n",
params.cpuload ? "CPUload\t" : "");
st->Record("-------------------------------------------------------"
"----------------------------------------------------\n");
for (T = params.T[0]; T <= params.T[1]; T *= params.factor) {
for (C = params.C[0]; C <= params.C[1]; C *= params.factor) {
for (S = params.S[0]; S <= params.S[1]; S *= params.factor) {
if (S < C)
printf("Error: chunksize (%llu) can not be"
"smaller than regionsize (%llu)\n", S, C);
for (N = params.N[0]; N <= params.N[1]; N *= params.factor) {
for (O = params.O[0]; O <= params.O[1]; O *= params.factor) {
BUG_ON(O < S || O < C);
memset(&args, 0, sizeof(args));
args.runno = runno;
args.threadcount = T;
args.regioncount = N;
args.chunksize = C;
args.regionsize = S;
args.offset = O;
args.st = st;
args.fpp = params.fpp;
OneRun(&args);
runno++;
}
}
}
}
}
st->Record("------------------------------------------------------"
"---------------------------------------------------\n");
delete st;
}