(ack *types.SignedAckHeader)
| 618 | } |
| 619 | |
| 620 | func (a *explorerAPI) formatAck(ack *types.SignedAckHeader) map[string]interface{} { |
| 621 | return map[string]interface{}{ |
| 622 | "ack": map[string]interface{}{ |
| 623 | "request": map[string]interface{}{ |
| 624 | "hash": ack.GetRequestHash().String(), |
| 625 | "timestamp": a.formatTime(ack.GetRequestTimestamp()), |
| 626 | "node": ack.Response.Request.NodeID, |
| 627 | "type": ack.Response.Request.QueryType.String(), |
| 628 | "count": ack.Response.Request.BatchCount, |
| 629 | }, |
| 630 | "response": map[string]interface{}{ |
| 631 | "hash": ack.GetResponseHash().String(), |
| 632 | "timestamp": a.formatTime(ack.GetResponseTimestamp()), |
| 633 | "node": ack.Response.NodeID, |
| 634 | "log_id": ack.Response.LogOffset, // savepoint id in eventual consistency mode |
| 635 | "last_insert_id": ack.Response.LastInsertID, |
| 636 | "affected_rows": ack.Response.AffectedRows, |
| 637 | }, |
| 638 | "hash": ack.Hash().String(), |
| 639 | "timestamp": a.formatTime(ack.Timestamp), |
| 640 | "node": ack.NodeID, |
| 641 | }, |
| 642 | } |
| 643 | } |
| 644 | |
| 645 | func (a *explorerAPI) formatTime(t time.Time) float64 { |
| 646 | return float64(t.UnixNano()) / 1e6 |
no test coverage detected