All Downloads are FREE. Search and download functionalities are using the official Maven repository.

info.mikaelsvensson.devtools.analysis.db2eventlog.Db2EventLogAnalyzer Maven / Gradle / Ivy

/*
 * Copyright 2014 Mikael Svensson
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package info.mikaelsvensson.devtools.analysis.db2eventlog;

import info.mikaelsvensson.devtools.analysis.shared.AbstractAnalyzer;
import info.mikaelsvensson.devtools.analysis.shared.CliHelp;
import org.apache.commons.cli.CommandLine;

import java.io.File;

/**
 * Summarizes DB2 event log generated by the db2evmon utility.
 */
@CliHelp(text = "Utility for summarizing the (very) verbose text output from the db2evmon utility.")
public class Db2EventLogAnalyzer extends AbstractAnalyzer {
    public static void main(String[] args) throws Exception {
        new Db2EventLogAnalyzer().run(args);
    }

    @Override
    protected void runImpl(CommandLine commandLine, String[] files, String reportFileName) throws Exception {
        for (String file : files) {
            Db2EventLogReport report = Db2EventLogReport.fromLogFile(new File(file), "ISO-8859-1");
            final Db2EventLogReportGenerator reportGenerator = new Db2EventLogReportGenerator(report);
            reportGenerator.generateReport(new File(reportFileName), null);
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy