本文整理汇总了C#中Connect.Init方法的典型用法代码示例。如果您正苦于以下问题:C# Connect.Init方法的具体用法?C# Connect.Init怎么用?C# Connect.Init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Connect
的用法示例。
在下文中一共展示了Connect.Init方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Test01
void Test01()
{
var gd = new Connect();
var sample = new Sample
{
Method = "GET",
Uri = "/test",
Timestamp = DateTime.Now.TimeOfDay.TotalMilliseconds,
ResponseTime = 100,
CpuTime = 20,
Context =
new[]
{
new Context {Name = "/", ResponseTime = 11},
new Context {Name = "/one", ResponseTime = 12},
new Context {Name = "/two", ResponseTime = 13}
}
};
gd.Init("26873", "testing", logger, null);
for (int i = 0; i < 1000; i++)
{
gd.Store(sample, logger, null);
Thread.Sleep(300);
}
gd.Term(logger, null);
Console.Read();
}
示例2: SqlTraceReader
private SqlTraceReader(EventLog eventLog, string workDirectory)
{
try
{
_eventLog = eventLog;
_workDirectory = workDirectory;
_parser = new Parser();
_agentConnect = new Connect();
_agentConnect.Init(Properties.Settings.Default.Port.ToString(), Properties.Settings.Default.Source,
Logger);
_thread = new Thread(Worker) {IsBackground = true};
_termHandle = new EventWaitHandle(false, EventResetMode.ManualReset);
_thread.Start();
}
catch (Exception ex)
{
Exit(string.Format("SqlTraceReader failed to start due to exception. {0}", ex));
}
}