public void EndExecute(ICursor cursor, IGxConnection con) { if (con != null) { con.LastSQLStatementEnded = true; } DataStoreProviderInfo dsInfo = WMIDataStoreProviders.Instance().GetDataStoreProviderInfo(this.name); SentenceInfo sInfo = dsInfo.GetSentenceInfo(this.name + "_" + cursor.Id); long diff = DateTime.Now.Subtract(beginExecute).Ticks / TimeSpan.TicksPerMillisecond; sInfo.setTimeExecute(diff); }
public void IncSentencesCount(ICursor cursor) { try { GXLogging.Debug(log, "IncSentencesCount"); DataStoreProviderInfo dsInfo = (DataStoreProviderInfo)instanceProvidersBase.GetDataStoreProviderInfo(this.name); dsInfo.incSentenceCount(); SentenceInfo sInfo = dsInfo.AddSentenceInfo(this.name + "_" + cursor.Id, cursor.SQLStatement); sInfo.incSentenceCount(); instanceProvidersBase.IncSentencesCount(cursor); beginExecute = DateTime.Now; this.statementCount++; string sqlSnt = cursor.SQLStatement; if (cursor is ForEachCursor) { statementSelectCount++; } else if (cursor is UpdateCursor) { if (sqlSnt.ToUpper().StartsWith("UPDATE")) { statementUpdateCount++; } else if (sqlSnt.ToUpper().StartsWith("DELETE")) { statementDeleteCount++; } else if (sqlSnt.ToUpper().StartsWith("INSERT")) { statementInsertCount++; } } else if (cursor is CallCursor) { statementCallCount++; } else if (cursor is DirectStatement) { statementDirectSQLCount++; } } catch (Exception e) { GXLogging.Error(log, "IncSentencesCount Error", e); } }
public WMISentence(DataStoreProviderInfo dsInfo, String name) { sentenceInfo = dsInfo.GetSentenceInfo(name); sentenceInfo.sentence = this; Instrumentation.Publish(this); }