File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 66 "crypto/x509"
77 "fmt"
88 "net/rpc"
9- "os"
109 "net/url"
10+ "os"
11+ "time"
1112
1213 "github.com/cybertec-postgresql/pgwatch/v3/internal/log"
1314 "github.com/cybertec-postgresql/pgwatch/v3/internal/metrics"
@@ -71,10 +72,16 @@ func (rw *RPCWriter) Write(msg metrics.MeasurementEnvelope) error {
7172 if rw .ctx .Err () != nil {
7273 return rw .ctx .Err ()
7374 }
75+
76+ t1 := time .Now ()
7477 var logMsg string
7578 if err := rw .client .Call ("Receiver.UpdateMeasurements" , & msg , & logMsg ); err != nil {
7679 return err
7780 }
81+
82+ diff := time .Since (t1 )
83+ written := len (msg .Data )
84+ log .GetLogger (rw .ctx ).WithField ("rows" , written ).WithField ("elapsed" , diff ).Info ("measurements written" )
7885 if len (logMsg ) > 0 {
7986 log .GetLogger (rw .ctx ).Info (logMsg )
8087 }
You can’t perform that action at this time.
0 commit comments