本文整理汇总了C#中ObservableEventListener.LogToBigQuery方法的典型用法代码示例。如果您正苦于以下问题:C# ObservableEventListener.LogToBigQuery方法的具体用法?C# ObservableEventListener.LogToBigQuery怎么用?C# ObservableEventListener.LogToBigQuery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObservableEventListener
的用法示例。
在下文中一共展示了ObservableEventListener.LogToBigQuery方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main(string[] args)
{
if (args.Length < 5)
{
Console.WriteLine("Mamemaki.Slab.BigQuery.PlayGround.exe <projectId> <datasetId> <tableId> <serviceAccountEmail> <privateKeyFile>");
return;
}
var projectId = args[0];
var datasetId = args[1];
var tableId = args[2];
var serviceAccountEmail = args[3];
var privateKeyFile = args[4];
var tableSchemaFile = args[5];
using (var listenerConsole = new ObservableEventListener())
using (var listener = new ObservableEventListener())
{
var formatterConsole = new EventTextFormatter(
"+=========================================+");
// Setup listener for debug
listenerConsole.EnableEvents(SemanticLoggingEventSource.Log, EventLevel.LogAlways);
listenerConsole.EnableEvents(BigQuerySinkEventSource.Log, EventLevel.LogAlways);
listenerConsole.LogToConsole(formatterConsole);
// Setup listener for playgrond
listener.EnableEvents(PlayGroundEventSource.Log, EventLevel.LogAlways);
listener.LogToConsole(formatterConsole);
listener.LogToBigQuery(
projectId: projectId,
datasetId: datasetId,
tableId: tableId,
authMethod: "private_key",
serviceAccountEmail: serviceAccountEmail,
privateKeyFile: privateKeyFile,
privateKeyPassphrase: "notasecret",
autoCreateTable: true,
tableSchemaFile: tableSchemaFile,
insertIdFieldName: "%uuid%",
bufferingInterval: TimeSpan.FromSeconds(1),
bufferingCount: 3,
bufferingFlushAllTimeout: Constants.DefaultBufferingFlushAllTimeout,
maxBufferSize: 30000);
PlayGroundEventSource.Log.Trace("start");
InsertRows(3);
Thread.Sleep(1);
InsertRows(3);
PlayGroundEventSource.Log.Trace("end");
}
Console.WriteLine("Press any key to exit");
Console.ReadLine();
}