示例#1
0
        static void Main(string[] args)
        {
            //TraceStoreConnectionInformation info = new LocalTraceStoreConnectionInformation(
            //    @"D:\Repos\WindowsFabric\out\debug-amd64\bin\WinFabricTest\test\FabActFiveNodelCluster.test\TC",
            //    @"E:\crm_duplicate",
            //    @"D:\Repos\WindowsFabric\out\debug-amd64\bin\WinFabricTest\test\FabActFiveNodelCluster.test\TC");

            TraceStoreConnectionInformation info = new AzureTraceStoreConnectionInformation(
                "winfablrc",
                HandyUtil.SecureStringFromCharArray("<Insert key Here>"),
                "vipinrtobitlogsqt",
                "blobContainerRandmom",
                "e98a88aa63aa42b4",
                LocalDiskLogger.LogProvider);

            TraceStoreConnection connection = new TraceStoreConnection(info, LocalDiskLogger.LogProvider);
            ReadFilter           filter     = ReadFilter.CreateReadFilter(typeof(NodeOpeningTraceRecord));

            // SET your Duration.
            var duration = new Duration(
                DateTime.SpecifyKind(DateTime.Parse("2018-04-10 01:01:19.155"), DateTimeKind.Utc),
                DateTime.SpecifyKind(DateTime.UtcNow, DateTimeKind.Utc));

            var results = connection.EventStoreReader.WithinBound(duration).ReadBackwardAsync(filter, 500, CancellationToken.None).GetAwaiter().GetResult();

            Console.WriteLine("Count {0}", results.Count());
            foreach (var one in results)
            {
                Console.WriteLine(one.TimeStamp.ToString("yyyy-MM-dd HH:mm:ss.fff", CultureInfo.InvariantCulture) + " " + one);
                Console.WriteLine();
            }

            Console.Read();
        }
示例#2
0
        public EventStoreReader()
        {
            TraceStoreConnectionInformation connectionInfo = null;

            if (ClusterSettingsReader.IsOneBoxEnvironment())
            {
                EventStoreLogger.Logger.LogMessage("One Box Environment. Configuring local Reader");
                connectionInfo = new LocalTraceStoreConnectionInformation(
                    FabricEnvironment.GetDataRoot(),
                    FabricEnvironment.GetLogRoot(),
                    FabricEnvironment.GetCodePath());
            }
            else
            {
                EventStoreLogger.Logger.LogMessage("Cloud Environment. Configuring Cloud Reader");
                var operationalConsumer = ClusterSettingsReader.OperationalConsumer;
                if (operationalConsumer == null)
                {
                    throw new ConnectionParsingException(ErrorCodes.AzureConnectionInformationMissing, "Config is Missing Operational Store Connection information");
                }

                connectionInfo = new AzureTraceStoreConnectionInformation(
                    operationalConsumer.Connection.AccountName,
                    operationalConsumer.Connection.AccountKey,
                    operationalConsumer.TablesPrefix,
                    null,
                    operationalConsumer.DeploymentId,
                    EventStoreLogProvider.LogProvider);
            }

            var connection = new TraceStoreConnection(connectionInfo, EventStoreLogProvider.LogProvider);

            traceStoreReader = connection.EventStoreReader;
        }
 public AzureTableEventStoreReader(ILogProvider logProvider, AzureTraceStoreConnectionInformation connectionInformation) : base(
         logProvider,
         connectionInformation)
 {
 }
示例#4
0
 protected AzureStoreReader(ILogProvider logProvider, AzureTraceStoreConnectionInformation connectionInformation) : base(logProvider)
 {
     Assert.IsNotNull(connectionInformation, "connectionInformation != null");
     this.azureConnectionInformation = connectionInformation;
 }