Cancelado

C# Log Parsing Utility

A C# application will be developed that takes the log file output from a main application, parses that output, performs a few string parsing and date calculations based upon its content, and then displays the log output in a list view in a Windows Form interface. See the detailed description for the exact requirements of this log analysis utility.

## Deliverables

1) The program must consist of one Windows .exe file. It is OK if the .exe file requires one or more .dll's to be in the same directory in order to run, but the program cannot have any other prerequisite requirements other than the .NET framework 2.0, and cannot be distributed in an installer package.

2) The program must be written in C#, and the source must be delivered along with project files for MS Visual Studio 2005 only. The source must be clear, concise, well-organized and commented.

3) There will be a main window which primarily consists of a list view with several columns (see below). When the program is launched, it should automatically prompt the user for a file to open. The default file filter should be '*.[url removed, login to view]', with the label 'Database Query Trace Logs'. The user should also be able to select all files (*.*). If the user cancels the file dialog the program should exit. If the user chooses a file, the file should be parsed and displayed in the main window. The program is not required to allow the user to open new files after the initial one. Closing the main window by any means should exit the program.

4) The program should parse the file according to the following format (an example file will be provided):

1. The file will be compressed with the GZip algorithm.

2. The compressed data consists of UTF-8-encoded lines of comma-separated values. Any unicode character is allowed in a value, except for whitespace characters other than space (no embedded newlines). If a value contains a comma character, it will be enclosed in double quotes (""). If a value contains a double quote character, it will be enclosed in double quotes and the embedded quote character will be doubled (i.e. hi"there becomes "hi""there"). The values must be processed so that the enclosing and doubled quote characters are not part of the final output.

3. There are two types of lines in the files, with different values:

1. QueryNumber,START,ThreadID,ThreadName,MethodName,StartTime,SQL,Params 2. QueryNumber,END,EndQueryTime,EndProcessTime,NumResults

4. The fields are as follows:

1. QueryNumber: An integer. There should be one START and one END line for each distinct query number. This field allows you to match up which lines correspond to each other. If a START line is found with no corresponding END line, the program should pop up a warning saying "Hung Query Detected:" with the line displayed (the line should be truncated to a reasonable length for display). If an END line is found with no corresponding START line, the warning should read "Invalid END line found:".

2. START: the literal text "START".

3. ThreadID: An integer. Used along with ThreadName for filtering purposes (see below).

4. ThreadName: A string.

5. MethodName: A string.

6. StartTime: A date/time in the format: MM/dd/yyyy HH:mm:ss:fff.

The program must not fail to parse this timestamp regardless of the current globalization settings on the machine running the program.

7. SQL: A string containing a SQL query.

8. Params: A string.

9. END: the literal text "END".

10. EndQueryTime: A date/time in the same format as above.

11. EndProcessTime: A date/time in the same format as above.

12. NumResults: An integer. Not used by this program.

5. It is important that the program never attempt to store the entire file in memory; files can be multiple GB in size and they must be processed sequentially and only summary statistics for the file stored and displayed. 6. For each unique START and END line with the same query number, the following fields should be calculated:

1. Query Time: This is the time span between the "StartTime" and "EndQueryTime" timestamps.

2. Processing Time: This is the time span between the "EndQueryTime" and "EndProcessTime" timestamps.

3. Overall Time: This is the sum of the Query Time and Processing Time fields, or the time span between "StartTime" and "EndProcessTime".

4. Canonical Query: this consists of the string ": ", where is field #5 above, and CanonicalSQL is field #7 above, but with all literal values and 'in' clauses removed and replaced with placeholders. For example, the following query text: SELECT FOO FROM BAR WHERE A = 'abc123' AND B = 5 AND C IN (1, 2, 3) and D in ('a', 'b', 'c') and E = @someparam Would become the following: SELECT FOO FROM BAR WHERE A = {STR} AND B = {INT} AND C IN {IN} and D in {IN} and E = @someparam

Some notes:

1. SQL is case-insensitive, so 'In', 'IN', 'iN' etc. are all valid.

2. IN clauses are replaced completely, the literals inside them are not replaced. 3. IN clauses with literal values need to be replaced, but IN clauses with subqueries should not be (but the values inside the subqueries should be replaced the same as any other value).

5. Only literal strings and integers need to be considered. Strings are delimited by single quotes, and single quotes c can appear inside of them by doubling them; for details look up a SQL syntax reference.

6. Parameters (identifiers starting with @) are not replaced.

5) If there is an error parsing a line of the file, the program should display a message in the user interface, but otherwise continue parsing the file and displaying the results as normal.

6) The list view in the main window should contain the following columns: 1. Canonical Query 2. Count 3. Total Query Time 4. Total Processing Time 5. Total Overall Time

7) The list should contain one item for each unique Canonical Query text. Count is the number of queries with that text. The other column values are calculated by summing the corresponding calculated fields for each item.

8) The list should be sortable in ascending or descending order by any of the columns, the default sort when the program starts should be total overall time, descending.

9) All time values should be in seconds, displayed as floating point with up to 3 digits of precision, and commas every 3 digits to the left of the decimal point.

10) Double clicking on any item in the list should pop up a window showing: 1. The text in the Canonical query column. 2. One of the SQL values that the canonical query text was generated from. 3. The Params value corresponding to that SQL text. 4. All of the above 3 values should be displayed word-wrapped and the text should be selectable so it can be copied to the clipboard.

11) There should be a button or some other control accessible from the main view which allows the user to see a list of distinct ThreadID:ThreadName combinations. This should be labeled "Filter by Threads...". The user should be able to select one or more of these combinations, and when the user clicks a button (labeled "OK" or "Update"), the main view should update and only show entries and statistics corresponding to the selected threads.

12) The winning bidder will receive the source code file from the main application that is responsible for generating the log, as well as sample log files to assist in the development and testing of the application. Acceptance of the application will include testing against additional log file samples.

Sample log snippit:

212,START,46,Engine Manager for incoming engine,[url removed, login to view],01/21/2011 11:01:05:108,"select [url removed, login to view], [url removed, login to view], [url removed, login to view], [url removed, login to view], [url removed, login to view], [url removed, login to view], [url removed, login to view], [url removed, login to view] from NetworkProfile where [url removed, login to view] = @ScanEngineID;",@ScanEngineID=1

212,END,01/21/2011 11:01:05:108,01/21/2011 11:01:05:108,4 213,START,40,Scan task queue reader,[url removed, login to view],01/21/2011 11:01:06:108,"select [url removed, login to view], [url removed, login to view], [url removed, login to view], [url removed, login to view], [url removed, login to view], [url removed, login to view], [url removed, login to view], [url removed, login to view] from NetworkProfile where [url removed, login to view] in (1);",

213,END,01/21/2011 11:01:06:108,01/21/2011 11:01:06:108,4

214,START,40,Scan task queue reader,[url removed, login to view],01/21/2011 11:01:06:108,"update ScanTaskInstance set State = @State, RanAt = @RanAt from ScanTaskInstance where [url removed, login to view] in (1, 2, 3, 8) and [url removed, login to view] = @State1 and [url removed, login to view] <= @ScheduledFor;",@State=1;@RanAt=1/21/2011 11:01:06 AM;@State1=0;@ScheduledFor=1/21/2011 11:01:11 AM

214,END,01/21/2011 11:01:06:108,01/21/2011 11:01:06:108,0

215,START,40,Scan task queue reader,[url removed, login to view],01/21/2011 11:01:06:108,"select [url removed, login to view], [url removed, login to view], [url removed, login to view], [url removed, login to view], [url removed, login to view], [url removed, login to view], [url removed, login to view], [url removed, login to view], [url removed, login to view], [url removed, login to view], [url removed, login to view], [url removed, login to view], [url removed, login to view], [url removed, login to view], [url removed, login to view], [url removed, login to view], [url removed, login to view], [url removed, login to view] from ScanTaskInstance where [url removed, login to view] in (1, 2, 3, 8) and [url removed, login to view] = @State and [url removed, login to view] = @Processed and [url removed, login to view] <= @ScheduledFor order by [url removed, login to view] ASC;",@State=1;@Processed=0;@ScheduledFor=1/21/2011 11:01:11 AM

215,END,01/21/2011 11:01:06:108,01/21/2011 11:01:06:108,0

216,START,36,Progress Event Sender,[url removed, login to view],01/21/2011 11:01:06:545,select count(*) as RecordCount from ScanTaskInstance Inner join NetworkProfile ON [url removed, login to view] = [url removed, login to view] where [url removed, login to view] = @ScanEngineID and [url removed, login to view] = @State;,@ScanEngineID=1;@State=1

216,END,01/21/2011 11:01:06:545,01/21/2011 11:01:06:545,1

Additional legal obligations of winning bidder:

4. CONFIDENTIALITY 4.1 Definition. "Confidential Information" means any Company proprietary information, technical data, trade secrets or know-how, including, but not limited to, research, product plans, products, services, customers, customer lists, markets, software, developments, inventions, processes, formulas, technology, designs, drawings, engineering, hardware configuration information, marketing, finances or other business information disclosed by Company either directly or indirectly in writing, orally or by drawings or inspection of parts or equipment. 4.2 Non-Use and Non-Disclosure. Consultant shall not, during or subsequent to the term of this Agreement, use Company's Confidential Information for any purpose whatsoever other than the performance of the Services on behalf of Company or disclose Company's Confidential Information to any third party. It is understood that said Confidential Information will remain the sole property of Company. Consultant further shall take all reasonable precautions to prevent any unauthorized disclosure of such Confidential Information including, but not limited to, having each employee of Consultant, if any, with access to any Confidential Information, execute a nondisclosure agreement containing provisions in Company's favor identical to this Section 1. Confidential Information does not include information which: (1) is known to Consultant at the time of disclosure to Consultant by Company, as evidenced by written records of Consultant; (2) has become publicly known and made generally available through no wrongful act of Consultant; or (3) has been rightfully received by Consultant from a third party who is authorized to make such disclosure. Without Company's prior written approval, Consultant shall not directly or indirectly disclose to anyone the existence of this Agreement or the fact that Consultant has this arrangement with Company. 4.3 Former Employer's Confidential Information. Consultant agrees that Consultant shall not, during the term of this Agreement, improperly use or disclose any proprietary information or trade secrets of any former or current employer or other person or entity with which Consultant has an agreement or duty to keep in confidence information acquired by Consultant, if any, and that Consultant shall not bring onto the premises of Company any unpublished document or proprietary information belonging to such employer, person or entity unless consented to in writing by such employer, person or entity. Consultant shall indemnify and hold Company harmless from and against all claims, liabilities, damages and expenses, including reasonable attorney's fees and costs of suit, arising out of or in connection with any violation or claimed violation of a third party's rights resulting in whole or in part from Company's use of the work product of Consultant under this Agreement. 4.4 Third Party Confidential Information. Consultant recognizes that Company has received and in the future will receive from third parties their confidential or proprietary information subject to a duty on Company's part to maintain the confidentiality of such information and to use it only for certain limited purposes. Consultant agrees that Consultant owes Company and such third parties, during the term of this Agreement and thereafter, a duty to hold all such confidential or proprietary information in the strictest confidence and not to disclose it to any person, firm or corporation or to use it except as necessary in carrying out the Services for Company consistent with Company's agreement with such third party. 4.5 Return of Materials. Upon the termination of this Agreement, or upon Company's earlier request, Consultant shall deliver to Company all of Company's property or Confidential Information that Consultant may have in Consultant's possession or control. 4.6 Services and Information Prior to Effective Date. All Services performed by Consultant and all information and other materials disclosed between the parties prior to the Effective Date shall be governed by the terms of this Agreement, except where those Services are covered by a separate consulting agreement between Consultant and Company.

5. OWNERSHIP 5.1 Assignment. Consultant acknowledges that all copyrightable material, notes, records, drawings, designs, inventions, improvements, developments, discoveries and trade secrets (collectively, "Work Product") conceived, made or discovered by Consultant, solely or in collaboration with others, during the term of this Agreement which relate in any manner to the business of Company that Consultant may be directed to undertake, investigate or experiment with, or which Consultant may become associated with in work, investigation or experimentation in the line of business of Company in performing the Services hereunder, are the sole property of Company. Consultant further shall assign (or cause to be assigned) and does hereby assign fully to Company all Work Product and any copyrights, patents, mask work rights or other intellectual property rights relating thereto. 5.2 Further Assurances. Consultant shall assist Company, or its designee, at Company's expense, in every proper way to secure Company's rights in the Work Product and any copyrights, patents, mask work rights or other intellectual property rights relating thereto in any and all countries, including the disclosure to Company of all pertinent information and data with respect thereto, the execution of all applications, specifications, oaths, assignments and all other instruments that Company deems necessary in order to apply for and obtain such rights and in order to assign and convey to Company, its successors, assigns and nominees the sole and exclusive right, title and interest in and to such Work Product, and any copyrights, patents, mask work rights or other intellectual property rights relating thereto. Consultant further agrees that Consultant's obligation to execute or cause to be executed, when it is in Consultant's power to do so, any such instrument or papers will continue after the termination of this Agreement. 5.3 Pre-Existing Materials. Consultant agrees that if in the course of performing the Services, Consultant incorporates into any Invention developed hereunder any invention, improvement, development, concept, discovery or other proprietary information owned by Consultant or in which Consultant has an interest, (1) Consultant shall inform Company, in writing before incorporating such invention, improvement, development, concept, discovery or other proprietary information into any Invention; and (2) Company is hereby granted and shall have a nonexclusive, royalty-free, perpetual, irrevocable, worldwide license to make, have made, modify, use and sell such item as part of or in connection with such Invention. Consultant shall not incorporate any invention, improvement, development, concept, discovery or other proprietary information owned by any third party into any Invention without Company's prior written permission. 5.4 Attorney in Fact. Where Company is unable because of Consultant's (1) unavailability after Company has made a good faith effort to contact Consultant; (2) dissolution; (3) mental or physical incapacity; or for any other reason, to secure Consultant's signature to apply for or to pursue any application for any United States or foreign patents or mask work or copyright registrations covering the Work Product assigned to Company above, then Consultant hereby irrevocably designates and appoints Company and its duly authorized officers and agents as Consultant's agent and attorney in fact, to act for and in Consultant's behalf and stead to execute and file any such applications and to do all other lawfully permitted acts to further the prosecution and issuance of patents, copyright and mask work registrations thereon with the same legal force and effect as if executed by Consultant. 5.5 Warranty. Consultant hereby represents and warrants that: (1) all Work Product will be the original work of Consultant; (2) the Work Product will not infringe the copyright, patent, trade secret, or any other intellectual property right of any third party; (3) the Work Product will not be obscene, libelous, or violate the right of privacy or publicity of any third party; (4) the Work Product will not contain any virus, trap door, worm, or any other device that is injurious or damaging to software or hardware used in conjunction with the Work Product; (5) Company shall retain and own all right, title and interest in and to all Work Product and any information delivered and/or shared hereunder; and (6) Consultant has no outstanding agreement or obligation that is in conflict with any of the provisions of this Agreement, or that would preclude Consultant from complying with the provisions hereof, and Consultant will not enter into any such conflicting Agreement during the term of this Agreement.

Habilidades: Programação C#, Engenharia, Microsoft, Gestão de projetos, Instalação de Script, Shell Script, Arquitetura de software, Teste de Software, Área de trabalho do Windows

Ver mais: parsing utility log, sample log parsing, log reader, written term papers, written research papers for free, written research papers, writing up an employee, writing third person, writing term papers, writing studio, writing services for research papers, writing services 108, writing secure code, writing prompt definition, writing in third person example, writing in third person, writing in the third person, writing instruments, writing formulas, writing character development, writing assignment application, writing an algorithm for a program, writing agents, writing a character reference, writing a character analysis

Acerca do Empregador:
( 4 comentários ) United States

ID do Projeto: #3060182

6 freelancers are bidding on average $147 for this job

goodlancer

See private message.

$85 USD in 14 dias
(54 Comentários)
4.9
njm137

See private message.

$187 USD in 14 dias
(23 Comentários)
4.8
akramkamal

See private message.

$212.5 USD in 14 dias
(47 Comentários)
4.8
ivankorhner

See private message.

$212.5 USD in 14 dias
(44 Comentários)
4.7
robotappsvw

See private message.

$157.25 USD in 14 dias
(26 Comentários)
4.7
coderexpertvw

See private message.

$85 USD in 14 dias
(19 Comentários)
4.0
tier2soft

See private message.

$153 USD in 14 dias
(0 Comentários)
0.0