コード例 #1
0
ファイル: Database.cs プロジェクト: polytronicgr/goesdump
 public void PutStatistic(DBStatistics statistics, bool autoTimestamp = true)
 {
     lock (statConn) {
         if (autoTimestamp)
         {
             statistics.Timestamp = LLTools.TimestampMS();
         }
         statConn.Insert(statistics);
     }
 }
コード例 #2
0
        public static void Update(DBStatistics stats)
        {
            lock (statistics) {
                stats.Timestamp = LLTools.TimestampMS();
                if (stats.Timestamp == lastTimestamp)
                {
                    stats.Timestamp++;
                }
                lastTimestamp = stats.Timestamp;

                statistics.Add(stats);
                if (LLTools.Timestamp() - lastCheck > checkInterval)
                {
                    long startTime = LLTools.TimestampMS();
                    // Time to dump
                    foreach (var s in statistics)
                    {
                        ConfigurationManager.PutStatistics(s, false);
                    }
                    statistics.Clear();
                    lastCheck = LLTools.Timestamp();
                }
            }
        }
コード例 #3
0
 public static void PutStatistics(DBStatistics statistics, bool autoTimestamp = true)
 {
     ConfigurationManager.db.PutStatistic(statistics, autoTimestamp);
 }
コード例 #4
0
 public static void PutStatistics(DBStatistics statistics, bool autoTimestamp = true)
 {
     db.PutStatistic(statistics, autoTimestamp);
 }