Release Indihiang 0.2.1 – Improvement on Parallel Computing Feature
Thanks for using Indihiang to analyze IIS log files or remote IIS. I try to improve Indihiang application such as features, performance, usability, etc.
Today I uploaded updated Indihiang application version 0.2.1. What’s the improvement in Indihiang 0.2.1? As you know, Indihiang 0.2 used parallel computing feature to analyze log IIS simultaneously. I improved parallel algorithm in Indihiang. Here are the improved codes:
1: try
2: {
3: var resultData = new Future<List<BaseLogAnalyzeFeature>>[listFiles.Count];
4: _mainTask = Task.Create(
5: delegate
6: {
7: Parallel.For(0, listFiles.Count, index =>
8: {
9: List<BaseLogAnalyzeFeature> features = IndihiangHelper.GenerateParallelFeatures(LogFileFormat);
10: resultData[index] = Future.Create(
11: () => ParseLogFile(features, listFiles[index])
12: );
13: resultData[index].Wait(-1);
14: });
15:
16: },
17: _taskManager.Value,
18: TaskCreationOptions.None
19: );
20:
21: _mainTask.Wait(-1);
22: for (int i = 0; i < resultData.Length; i++)
23: {
24: List<BaseLogAnalyzeFeature> items = resultData
.Value;
25: items.ForEach(delegate(BaseLogAnalyzeFeature item)
26: {
27: for (int j = 0; j < _paralleFeatures.Count; j++)
28: if (_paralleFeatures[j].FeatureName == item.FeatureName)
29: _paralleFeatures[j].SynchData(item.Items);
30: });
31:
32: items.Clear();
33: resultData
.Dispose();
34: }
35: Thread.Sleep(100);
36:
37: }
_mainTask object hold a task all analyzing computation. In this task, I created parallel task using Future<T> object to handle analyzing for a log file. I also passed TaskManager object in _mainTask object to optimize processor usage. I also implemented Lazy initialization for TaskManager object, here is the illustration code as below:
1: _taskManager = new LazyInit<TaskManager>(() => new TaskManager(
2: new TaskManagerPolicy(1, Environment.ProcessorCount)),
3: LazyInitMode.AllowMultipleExecution);
After all tasks created by Future<T> object, I tried to wait and make sure all tasks completed. After completed, Indihiang consolidated all log IIS files and rendered data on GUI.
What’s the Next?
Now, you download Indihiang 0.2.1 for x86 and x64 platforms. You also can download the latest source code on http://indihiang.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=29480
If you have any feedback please report on Indihiang portal http://www.codeplex.com/indihiang