@@ -58,10 +58,11 @@ while true
ARGV[0], 'pending_messages-' + ARGV[0])
t = Time.now
+ ts = "%d.%09d" % [t.to_i, t.nsec]
tai_timestamp = `./tai`.strip
tai_yyyymmdd = Time.at(tai_timestamp.to_i).strftime('%Y%m%d')
- puts "LOG %d.%09d, %s: handling message sent on %s ...\n" %
- [t.to_i, t.nsec, tai_timestamp, tai_yyyymmdd]
+ puts "LOG %s, %s: handling message sent on %s ...\n" %
+ [ts, tai_timestamp, tai_yyyymmdd]
# WARNING: since not atomic with setex() below, translator is singleton
day_msg_count = redis.incr(
@@ -77,9 +78,18 @@ while true
puts "TODO - got some stuff: " + timestamps_plus_json_blob
puts "TODO - daymsgcount: '#{day_msg_count}'"
- # TODO: add some timestamps to timestamps_plus_json_blob (our own)
+ t2 = Time.now
+ ts2 = "%d.%09d" % [t2.to_i, t2.nsec]
+ tai_timestamp2 = `./tai`.strip
- # TODO: fix so sending timestamps_plus_json_blob to SGX, and via POST
+ new_json_blob =
+ '"ts_040_tai-translator_pre_send":' + tai_timestamp2 +
+ ',"ts_040_unix-translator_pre_send":' + ts2 +
+ ',"ts_030_tai-translator_received":' + tai_timestamp +
+ ',"ts_030_unix-translator_received":' + ts +
+ ',' + timestamps_plus_json_blob
+
+ # TODO: fix so sending new_json_blob to SGX, and via POST
response = Net::HTTP.get_response(
URI("https://#{ARGV[1]}:#{ARGV[2]}/r2tst.php")
)
@@ -105,7 +115,7 @@ while true
# WARNING: since not atomic with incr() above, translator is singleton
rv1 = redis.setex(
"archived_message-#{ARGV[0]}-#{tai_yyyymmdd}-#{day_msg_count}",
- 259200, timestamps_plus_json_blob
+ 259200, new_json_blob
)
if rv1 != 'OK'
puts 'Translator terminated since archive message at index ' +