Revision a723a046 measures.c

View differences:

measures.c
17 17

  
18 18
#include "measures.h"
19 19
#include "grapes_msg_types.h"
20
#include "streamer.h"
20 21

  
21 22
struct timeval print_tdiff = {3600, 0};
22 23
struct timeval tstartdiff = {60, 0};
......
70 71

  
71 72
void print_measure(const char *name, double value)
72 73
{
73
  fprintf(stderr,"abouttopublish,,,,%s,%f,,,%f\n", name, value, tdiff_sec(&tnext, &tstart));
74
  static const struct nodeID *my_addr;
75
  static char *my_addr_str;
76

  
77
  //cache address to avoid recalculating it at every call
78
  if (my_addr != get_my_addr()) {
79
    if (my_addr) nodeid_free(my_addr);
80
    my_addr = nodeid_dup(get_my_addr());
81
    my_addr_str = strdup(node_addr(my_addr));
82
  }
83

  
84
  fprintf(stderr,"abouttopublish,%s,,,%s,%f,,,%f\n", my_addr_str, name, value, tdiff_sec(&tnext, &tstart));
74 85
}
75 86

  
76 87
void print_measures()

Also available in: Unified diff