//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: private QueryStatusResult(org.neo4j.kernel.api.query.QuerySnapshot query, org.neo4j.kernel.impl.core.EmbeddedProxySPI manager, java.time.ZoneId zoneId) throws org.neo4j.kernel.api.exceptions.InvalidArgumentsException private QueryStatusResult(QuerySnapshot query, EmbeddedProxySPI manager, ZoneId zoneId) { this.QueryId = ofInternalId(query.InternalQueryId()).ToString(); this.Username = query.Username(); this.Query = query.QueryText(); this.Parameters = AsRawMap(query.QueryParameters(), new ParameterWriter(manager)); this.StartTime = formatTime(query.StartTimestampMillis(), zoneId); this.ElapsedTimeMillis = MicrosAsMillis(query.ElapsedTimeMicros()).Value; this.ElapsedTime = formatInterval(ElapsedTimeMillis); ClientConnectionInfo clientConnection = query.ClientConnection(); this.ConnectionDetails = clientConnection.AsConnectionDetails(); this.Protocol = clientConnection.Protocol(); this.ClientAddress = clientConnection.ClientAddress(); this.RequestUri = clientConnection.RequestURI(); this.MetaData = query.TransactionAnnotationData(); this.CpuTimeMillis = MicrosAsMillis(query.CpuTimeMicros()); this.Status = query.Status(); this.ResourceInformation = query.ResourceInformation(); this.ActiveLockCount = query.ActiveLockCount(); this.WaitTimeMillis = MicrosAsMillis(query.WaitTimeMicros()).Value; this.IdleTimeMillis = MicrosAsMillis(query.IdleTimeMicros()); this.Planner = query.Planner(); this.Runtime = query.Runtime(); this.Indexes = query.Indexes(); this.AllocatedBytes = query.AllocatedBytes(); this.PageHits = query.PageHits(); this.PageFaults = query.PageFaults(); this.ConnectionId = clientConnection.ConnectionId(); }
public override void EndSuccess(ExecutingQuery query) { if (_isCollecting) { QuerySnapshot snapshot = query.Snapshot(); _queries.produce(new TruncatedQuerySnapshot(snapshot.QueryText(), snapshot.QueryPlanSupplier(), snapshot.QueryParameters(), snapshot.ElapsedTimeMicros(), snapshot.CompilationTimeMicros(), snapshot.StartTimestampMillis(), _maxQueryTextSize)); } }
private string LogEntry(QuerySnapshot query) { string sourceString = query.ClientConnection().asConnectionDetails(); string queryText = query.QueryText(); ISet <string> passwordParams = new HashSet <string>(); Matcher matcher = _passwordPattern.matcher(queryText); while (matcher.find()) { string password = matcher.group(1).Trim(); if (password[0] == '$') { passwordParams.Add(password.Substring(1)); } else if (password[0] == '{') { passwordParams.Add(password.Substring(1, (password.Length - 1) - 1)); } else { queryText = queryText.Replace(password, "******"); } } StringBuilder result = new StringBuilder(); result.Append(TimeUnit.MICROSECONDS.toMillis(query.ElapsedTimeMicros())).Append(" ms: "); if (_logDetailedTime) { QueryLogFormatter.FormatDetailedTime(result, query); } if (_logAllocatedBytes) { QueryLogFormatter.FormatAllocatedBytes(result, query); } if (_logPageDetails) { QueryLogFormatter.FormatPageDetails(result, query); } result.Append(sourceString).Append(" - ").Append(queryText); if (_logQueryParameters) { QueryLogFormatter.FormatMapValue(result.Append(" - "), query.QueryParameters(), passwordParams); } if (_logRuntime) { result.Append(" - runtime=").Append(query.Runtime()); } QueryLogFormatter.FormatMap(result.Append(" - "), query.TransactionAnnotationData()); return(result.ToString()); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: public TransactionStatusResult(org.neo4j.kernel.api.KernelTransactionHandle transaction, TransactionDependenciesResolver transactionDependenciesResolver, java.util.Map<org.neo4j.kernel.api.KernelTransactionHandle,java.util.List<org.neo4j.kernel.api.query.QuerySnapshot>> handleSnapshotsMap, java.time.ZoneId zoneId) throws org.neo4j.kernel.api.exceptions.InvalidArgumentsException public TransactionStatusResult(KernelTransactionHandle transaction, TransactionDependenciesResolver transactionDependenciesResolver, IDictionary <KernelTransactionHandle, IList <QuerySnapshot> > handleSnapshotsMap, ZoneId zoneId) { this.TransactionId = transaction.UserTransactionName; this.Username = transaction.Subject().username(); this.StartTime = ProceduresTimeFormatHelper.FormatTime(transaction.StartTime(), zoneId); Optional <Status> terminationReason = transaction.TerminationReason(); this.ActiveLockCount = transaction.ActiveLocks().count(); IList <QuerySnapshot> querySnapshots = handleSnapshotsMap[transaction]; TransactionExecutionStatistic statistic = transaction.TransactionStatistic(); ElapsedTimeMillis = statistic.ElapsedTimeMillis; CpuTimeMillis = statistic.CpuTimeMillis; AllocatedBytes = statistic.HeapAllocatedBytes; AllocatedDirectBytes = statistic.DirectAllocatedBytes; WaitTimeMillis = statistic.WaitTimeMillis; IdleTimeMillis = statistic.IdleTimeMillis; PageHits = statistic.PageHits; PageFaults = statistic.PageFaults; if (querySnapshots.Count > 0) { QuerySnapshot snapshot = querySnapshots[0]; ClientConnectionInfo clientConnectionInfo = snapshot.ClientConnection(); this.CurrentQueryId = ofInternalId(snapshot.InternalQueryId()).ToString(); this.CurrentQuery = snapshot.QueryText(); this.Protocol = clientConnectionInfo.Protocol(); this.ClientAddress = clientConnectionInfo.ClientAddress(); this.RequestUri = clientConnectionInfo.RequestURI(); this.ConnectionId = clientConnectionInfo.ConnectionId(); } else { this.CurrentQueryId = StringUtils.EMPTY; this.CurrentQuery = StringUtils.EMPTY; this.Protocol = StringUtils.EMPTY; this.ClientAddress = StringUtils.EMPTY; this.RequestUri = StringUtils.EMPTY; this.ConnectionId = StringUtils.EMPTY; } this.ResourceInformation = transactionDependenciesResolver.DescribeBlockingLocks(transaction); this.Status = GetStatus(transaction, terminationReason, transactionDependenciesResolver); this.MetaData = transaction.MetaData; }