include/ccKVS/inline_util.h
static inline void report_latency_of_hot_write(uint16_t index, struct cache_op* update_ops, struct latency_flags* latency_info,
											   struct extended_cache_op* ops, struct timespec* start, uint16_t local_client_id)
{
	if (keys_and_meta_are_equal(&update_ops[index].key, latency_info->key_to_measure)) {
		struct timespec end;
		clock_gettime(CLOCK_MONOTONIC, &end);
		int useconds = ((end.tv_sec - start->tv_sec) * 1000000) +
					   ((end.tv_nsec - start->tv_nsec) / 1000);
		if (ENABLE_ASSERTIONS) assert(useconds > 0);
		bookkeep_latency(useconds, HOT_WRITE_REQ);
//		printf("Client %d Latency of a hot write %d us\n", local_client_id, useconds);
		latency_info->measured_req_flag = NO_REQ;
	}
		// This works like a lease mechanism, to find out whether the write to be measured has actually been cacnelled
	else if (keys_are_equal(&update_ops[index].key, latency_info->key_to_measure)) {
		if (update_ops[index].key.meta.version > latency_info->key_to_measure->meta.version) {
			latency_info->measured_req_flag = NO_REQ;
		}
	}
}
// Count the coherence latency of a hot write
Count the coherence latency of a hot write
Count the coherence latency of a hot write
static inline void report_latency_of_hot_write(uint16_t index, struct cache_op* update_ops, struct latency_flags* latency_info,
											   struct extended_cache_op* ops, struct timespec* start, uint16_t local_client_id)
{
	if (keys_and_meta_are_equal(&update_ops[index].key, latency_info->key_to_measure)) {
		struct timespec end;
		clock_gettime(CLOCK_MONOTONIC, &end);
		int useconds = ((end.tv_sec - start->tv_sec) * 1000000) +
					   ((end.tv_nsec - start->tv_nsec) / 1000);
		if (ENABLE_ASSERTIONS) assert(useconds > 0);
		bookkeep_latency(useconds, HOT_WRITE_REQ);
		latency_info->measured_req_flag = NO_REQ;
	}
	else if (keys_are_equal(&update_ops[index].key, latency_info->key_to_measure)) {
		if (update_ops[index].key.meta.version > latency_info->key_to_measure->meta.version) {
			latency_info->measured_req_flag = NO_REQ;
		}
	}
}
static inline void report_latency_of_hot_write ( uint16_t index , struct cache_op * update_ops , struct latency_flags * latency_info , struct extended_cache_op * ops , struct timespec * start , uint16_t local_client_id ) { if ( keys_and_meta_are_equal ( & update_ops [ index ] . key , latency_info -> key_to_measure ) ) { struct timespec end ; clock_gettime ( CLOCK_MONOTONIC , & end ) ; int useconds = ( ( end . tv_sec - start -> tv_sec ) * 1000000 ) + ( ( end . tv_nsec - start -> tv_nsec ) / 1000 ) ; if ( ENABLE_ASSERTIONS ) assert ( useconds > 0 ) ; bookkeep_latency ( useconds , HOT_WRITE_REQ ) ; latency_info -> measured_req_flag = NO_REQ ; } else if ( keys_are_equal ( & update_ops [ index ] . key , latency_info -> key_to_measure ) ) { if ( update_ops [ index ] . key . meta . version > latency_info -> key_to_measure -> meta . version ) { latency_info -> measured_req_flag = NO_REQ ; } } }
Count the coherence latency of a hot write
Count the coherence latency of a hot write
//		printf("Client %d Latency of a hot write %d us\n", local_client_id, useconds); // This works like a lease mechanism, to find out whether the write to be measured has actually been cacnelled