FACT++  1.0
int main ( int  argc,
char *  argv[] 
)

Definition at line 28 of file benchClient.cxx.

References dic_get_id(), DimBrowser::getNextService(), DimBrowser::getServices(), i, MsgSize, NReceived, ServerName, and TEST_TIME.

29 {
30  int i, nServices = 0;
31  Service **services;
32  float mps,tpm;
33  DimBrowser br;
34  char *name, *format, *cltptr, *srvptr, clientName[128];
35 
36  if(argc){}
37  if(argv){}
38  br.getServices("BENCH_SERVICE_*");
39 
40  while(br.getNextService(name, format)!= 0)
41  {
42  nServices++;
43  }
44  services = new Service*[nServices];
45  i = 0;
46  while(br.getNextService(name, format)!= 0)
47  {
48  services[i++] = new Service(name);
49  }
50  dic_get_id(clientName);
51  if((cltptr = strchr(clientName,'@')))
52  cltptr++;
53  sleep(5);
54  NReceived = 0;
55 
56  sleep(TEST_TIME);
57 
58  mps = NReceived/TEST_TIME;
59  if((srvptr = strchr(ServerName,'@')))
60  srvptr++;
61  cout << "Benchmark from "<< srvptr << " to " << cltptr << " :" << endl;
62  cout << "Server publishes " << nServices << " services of " << MsgSize << " bytes each"<< endl;
63  cout << "Result :" << endl;
64  cout << "\tMessages/s = " << mps << endl;
65  tpm = 1/(float)mps*1000;
66  cout << "\tTime(ms)/message = " << tpm << endl;
67  cout << "\tThroughput (Kb/s) = " << mps*MsgSize/1024 << endl;
68  return 1;
69 }
#define TEST_TIME
Definition: benchClient.cxx:5
int dic_get_id(char *name)
Definition: dic.c:2062
char ServerName[128]
Definition: benchClient.cxx:7
int i
Definition: db_dim_client.c:21
int getServices(const char *serviceName)
Definition: diccpp.cxx:849
int NReceived
Definition: benchClient.cxx:10
int MsgSize
Definition: benchClient.cxx:8
int getNextService(char *&service, char *&format)
Definition: diccpp.cxx:948

+ Here is the call graph for this function: