2 /// This file is part of the LWES .NET Binding (LWES.net)
4 /// COPYRIGHT (C) 2009, Phillip Clark (cerebralkungfu[at*g mail[dot*com)
5 /// original .NET implementation
7 /// LWES.net is free software: you can redistribute it and/or modify
8 /// it under the terms of the GNU General Public License as published by
9 /// the Free Software Foundation, either version 3 of the License, or
10 /// (at your option) any later version.
12 /// LWES.net is distributed in the hope that it will be useful,
13 /// but WITHOUT ANY WARRANTY; without even the implied warranty of
14 /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 /// GNU General Public License for more details.
17 /// You should have received a copy of the GNU General Public License
18 /// along with LWES.net. If not, see <http://www.gnu.org/licenses/>.
19 ///namespace Lwes_test_emitter_console
20 namespace Lwes_test_emitter_console
23 using System
.Diagnostics
;
24 using System
.Threading
;
27 using Org
.Lwes
.Emitter
;
33 static void Main(string[] args
)
35 // Use emit some trace messages - these will route through
36 // the configured LwesTraceListener to the LWES.
37 // This is how most DotNet applications will interact with LWES.
38 TraceSource ts
= new TraceSource("Console");
39 ts
.TraceEvent(TraceEventType
.Verbose
, 1, "Starting Lwes-test-emitter-console");
41 var control
= new { NumberOfEventsToEmit = 10000, MaxNumberOfAttributes = 44 }
;
43 Console
.WriteLine(String
.Format("LWES EventEmitter - \r\nThis console will generate and emit {0} random events to the LWES"
44 , control
.NumberOfEventsToEmit
.ToString("N0")));
48 // Create an emitter - this is the emitter named in the lwes/emitters
49 // configuration node.
50 using (IEventEmitter emitter
= EventEmitter
.CreateDefault())
52 for (int i
= 0; i
< control
.NumberOfEventsToEmit
; i
++)
54 Event ev
= EventUtils
.GenerateRandomEvent(String
.Concat("TestEvent_", i
), control
.MaxNumberOfAttributes
, SupportedEncoding
.UTF_8
);
59 ts
.TraceEvent(TraceEventType
.Verbose
, 2, "Exiting Lwes-test-emitter-console");