Пример #1
0
        public IList <RuntimeStatusData> GetRuntimeStatus(string runtimeHash, int session, int sequenceIndex)
        {
            string filter =
                $"{DataBaseItemNames.RuntimeIdColumn}='{runtimeHash}' AND {DataBaseItemNames.SessionIdColumn}={session} AND {DataBaseItemNames.SequenceIndexColumn}={sequenceIndex}";
            string cmd = SqlCommandFactory.CreateQueryCmdWithOrder(filter, DataBaseItemNames.StatusTableName,
                                                                   DataBaseItemNames.StatusIndexColumn);
            List <RuntimeStatusData> statusDatas = new List <RuntimeStatusData>(500);

            using (DbDataReader dataReader = ExecuteReadCommand(cmd))
            {
                while (dataReader.Read())
                {
                    RuntimeStatusData runtimeStatusData = new RuntimeStatusData();
                    DataModelMapper.ReadToObject(dataReader, runtimeStatusData);
                    statusDatas.Add(runtimeStatusData);
                }
            }
            return(statusDatas);
        }
Пример #2
0
        public virtual IList <PerformanceStatus> GetPerformanceStatus(string runtimeHash, int session)
        {
            string filter =
                $"{DataBaseItemNames.RuntimeIdColumn}='{runtimeHash}' AND {DataBaseItemNames.SessionIdColumn}={session}";
            string cmd = SqlCommandFactory.CreateQueryCmdWithOrder(filter, DataBaseItemNames.PerformanceTableName,
                                                                   DataBaseItemNames.StatusIndexColumn);
            List <PerformanceStatus> performanceStatuses = new List <PerformanceStatus>(500);

            using (DbDataReader dataReader = ExecuteReadCommand(cmd))
            {
                while (dataReader.Read())
                {
                    PerformanceStatus performanceStatus = new PerformanceStatus();
                    DataModelMapper.ReadToObject(dataReader, performanceStatus);
                    performanceStatuses.Add(performanceStatus);
                }
            }
            return(performanceStatuses);
        }
Пример #3
0
        public IList <RuntimeStatusData> GetRuntimeStatusInRange(string runtimeHash, int session, long startIndex, long count)
        {
            string filter =
                $"{DataBaseItemNames.RuntimeIdColumn}='{runtimeHash}' AND {DataBaseItemNames.SessionIdColumn}={session} AND {DataBaseItemNames.StatusIndexColumn} >= {startIndex}";
            string cmd = SqlCommandFactory.CreateQueryCmdWithOrder(filter, DataBaseItemNames.StatusTableName, DataBaseItemNames.StatusIndexColumn);

            if (count > 0)
            {
                cmd += $" LIMIT {count}";
            }
            List <RuntimeStatusData> statusDatas = new List <RuntimeStatusData>(500);

            using (DbDataReader dataReader = ExecuteReadCommand(cmd))
            {
                while (dataReader.Read())
                {
                    RuntimeStatusData runtimeStatusData = new RuntimeStatusData();
                    DataModelMapper.ReadToObject(dataReader, runtimeStatusData);
                    statusDatas.Add(runtimeStatusData);
                }
            }
            statusDatas.TrimExcess();
            return(statusDatas);
        }