Example #1
0
 public SentenceInfo AddSentenceInfo(String key, String sqlSentence)
 {
     if (!sentenceInfo.ContainsKey(key))
     {
         SentenceInfo sInfo = new SentenceInfo(key, sqlSentence);
         sentenceInfo.Add(key, sInfo);
         sInfo.sentence = new WMISentence(this, key);
     }
     return((SentenceInfo)sentenceInfo[key]);
 }
Example #2
0
        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);
        }
Example #3
0
        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);
            }
        }
Example #4
0
 public WMISentence(DataStoreProviderInfo dsInfo, String name)
 {
     sentenceInfo          = dsInfo.GetSentenceInfo(name);
     sentenceInfo.sentence = this;
     Instrumentation.Publish(this);
 }