ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [35/76] [abbrv] incubator-ignite git commit: # IGNITE-226: WIP.
Date Fri, 13 Feb 2015 18:03:41 GMT
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9b49a585/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsMetrics.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsMetrics.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsMetrics.java
new file mode 100644
index 0000000..cec1e92
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsMetrics.java
@@ -0,0 +1,350 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 org.apache.ignite.internal.visor.igfs;
+
+import org.apache.ignite.igfs.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+
+import java.io.*;
+
+/**
+ * Data transfer object for {@link org.apache.ignite.igfs.IgfsMetrics}.
+ */
+public class VisorIgfsMetrics implements Serializable {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** Maximum amount of data that can be stored on local node. */
+    private long totalSpaceSz;
+
+    /** Local used space in bytes on local node. */
+    private long usedSpaceSz;
+
+    /** Number of directories created in file system. */
+    private int foldersCnt;
+
+    /** Number of files stored in file system. */
+    private int filesCnt;
+
+    /** Number of files that are currently opened for reading on local node. */
+    private int filesOpenedForRd;
+
+    /** Number of files that are currently opened for writing on local node. */
+    private int filesOpenedForWrt;
+
+    /** Total blocks read, local and remote. */
+    private long blocksRd;
+
+    /** Total remote blocks read. */
+    private long blocksRdRmt;
+
+    /** Total blocks write, local and remote. */
+    private long blocksWrt;
+
+    /** Total remote blocks write. */
+    private long blocksWrtRmt;
+
+    /** Total bytes read. */
+    private long bytesRd;
+
+    /** Total bytes read time. */
+    private long bytesRdTm;
+
+    /** Total bytes write. */
+    private long bytesWrt;
+
+    /** Total bytes write time. */
+    private long bytesWrtTm;
+
+    /**
+     * @param m GGFS metrics.
+     * @return Data transfer object for given GGFS metrics.
+     */
+    public static VisorIgfsMetrics from(IgfsMetrics m) {
+        assert m != null;
+
+        VisorIgfsMetrics metrics = new VisorIgfsMetrics();
+
+        metrics.totalSpaceSize(m.maxSpaceSize());
+        metrics.usedSpaceSize(m.localSpaceSize());
+        metrics.foldersCount(m.directoriesCount());
+        metrics.filesCount(m.filesCount());
+        metrics.filesOpenedForRead(m.filesOpenedForRead());
+        metrics.filesOpenedForWrite(m.filesOpenedForWrite());
+        metrics.blocksRead(m.blocksReadTotal());
+        metrics.blocksReadRemote(m.blocksReadRemote());
+        metrics.blocksWritten(m.blocksWrittenTotal());
+        metrics.blocksWrittenRemote(m.blocksWrittenRemote());
+        metrics.bytesRead(m.bytesRead());
+        metrics.bytesReadTime(m.bytesReadTime());
+        metrics.bytesWritten(m.bytesWritten());
+        metrics.bytesWriteTime(m.bytesWriteTime());
+
+        return metrics;
+    }
+
+    /**
+     * Add given metrics.
+     *
+     * @param m Metrics to add.
+     * @return Self for method chaining.
+     */
+    public VisorIgfsMetrics add(VisorIgfsMetrics m) {
+        assert m != null;
+
+        totalSpaceSz += m.totalSpaceSz;
+        usedSpaceSz += m.usedSpaceSz;
+        foldersCnt += m.foldersCnt;
+        filesCnt += m.filesCnt;
+        filesOpenedForRd += m.filesOpenedForRd;
+        filesOpenedForWrt += m.filesOpenedForWrt;
+        blocksRd += m.blocksRd;
+        blocksRdRmt += m.blocksRdRmt;
+        blocksWrt += m.blocksWrt;
+        blocksWrtRmt += m.blocksWrtRmt;
+        bytesRd += m.bytesRd;
+        bytesRdTm += m.bytesRdTm;
+        bytesWrt += m.bytesWrt;
+        bytesWrtTm += m.bytesWrtTm;
+
+        return this;
+    }
+
+    /**
+     * Aggregate metrics.
+     *
+     * @param n Nodes count.
+     * @return Self for method chaining.
+     */
+    public VisorIgfsMetrics aggregate(int n) {
+        if (n > 0) {
+            foldersCnt /= n;
+            filesCnt /= n;
+        }
+
+        return this;
+    }
+
+    /**
+     * @return Maximum amount of data that can be stored on local node.
+     */
+    public long totalSpaceSize() {
+        return totalSpaceSz;
+    }
+
+    /**
+     * @param totalSpaceSz New maximum amount of data that can be stored on local node.
+     */
+    public void totalSpaceSize(long totalSpaceSz) {
+        this.totalSpaceSz = totalSpaceSz;
+    }
+
+    /**
+     * @return Local used space in bytes on local node.
+     */
+    public long usedSpaceSize() {
+        return usedSpaceSz;
+    }
+
+    /**
+     * @param usedSpaceSz New local used space in bytes on local node.
+     */
+    public void usedSpaceSize(long usedSpaceSz) {
+        this.usedSpaceSz = usedSpaceSz;
+    }
+
+    /**
+     * @return Local free space in bytes on local node.
+     */
+    public long freeSpaceSize() {
+        return totalSpaceSz - usedSpaceSz;
+    }
+
+    /**
+     * @return Number of directories created in file system.
+     */
+    public int foldersCount() {
+        return foldersCnt;
+    }
+
+    /**
+     * @param foldersCnt New number of directories created in file system.
+     */
+    public void foldersCount(int foldersCnt) {
+        this.foldersCnt = foldersCnt;
+    }
+
+    /**
+     * @return Number of files stored in file system.
+     */
+    public int filesCount() {
+        return filesCnt;
+    }
+
+    /**
+     * @param filesCnt New number of files stored in file system.
+     */
+    public void filesCount(int filesCnt) {
+        this.filesCnt = filesCnt;
+    }
+
+    /**
+     * @return Number of files that are currently opened for reading on local node.
+     */
+    public int filesOpenedForRead() {
+        return filesOpenedForRd;
+    }
+
+    /**
+     * @param filesOpenedForRd New number of files that are currently opened for reading on local node.
+     */
+    public void filesOpenedForRead(int filesOpenedForRd) {
+        this.filesOpenedForRd = filesOpenedForRd;
+    }
+
+    /**
+     * @return Number of files that are currently opened for writing on local node.
+     */
+    public int filesOpenedForWrite() {
+        return filesOpenedForWrt;
+    }
+
+    /**
+     * @param filesOpenedForWrt New number of files that are currently opened for writing on local node.
+     */
+    public void filesOpenedForWrite(int filesOpenedForWrt) {
+        this.filesOpenedForWrt = filesOpenedForWrt;
+    }
+
+    /**
+     * @return Total blocks read, local and remote.
+     */
+    public long blocksRead() {
+        return blocksRd;
+    }
+
+    /**
+     * @param blocksRd New total blocks read, local and remote.
+     */
+    public void blocksRead(long blocksRd) {
+        this.blocksRd = blocksRd;
+    }
+
+    /**
+     * @return Total remote blocks read.
+     */
+    public long blocksReadRemote() {
+        return blocksRdRmt;
+    }
+
+    /**
+     * @param blocksRdRmt New total remote blocks read.
+     */
+    public void blocksReadRemote(long blocksRdRmt) {
+        this.blocksRdRmt = blocksRdRmt;
+    }
+
+    /**
+     * @return Total blocks write, local and remote.
+     */
+    public long blocksWritten() {
+        return blocksWrt;
+    }
+
+    /**
+     * @param blocksWrt New total blocks write, local and remote.
+     */
+    public void blocksWritten(long blocksWrt) {
+        this.blocksWrt = blocksWrt;
+    }
+
+    /**
+     * @return Total remote blocks write.
+     */
+    public long blocksWrittenRemote() {
+        return blocksWrtRmt;
+    }
+
+    /**
+     * @param blocksWrtRmt New total remote blocks write.
+     */
+    public void blocksWrittenRemote(long blocksWrtRmt) {
+        this.blocksWrtRmt = blocksWrtRmt;
+    }
+
+    /**
+     * @return Total bytes read.
+     */
+    public long bytesRead() {
+        return bytesRd;
+    }
+
+    /**
+     * @param bytesRd New total bytes read.
+     */
+    public void bytesRead(long bytesRd) {
+        this.bytesRd = bytesRd;
+    }
+
+    /**
+     * @return Total bytes read time.
+     */
+    public long bytesReadTime() {
+        return bytesRdTm;
+    }
+
+    /**
+     * @param bytesRdTm New total bytes read time.
+     */
+    public void bytesReadTime(long bytesRdTm) {
+        this.bytesRdTm = bytesRdTm;
+    }
+
+    /**
+     * @return Total bytes write.
+     */
+    public long bytesWritten() {
+        return bytesWrt;
+    }
+
+    /**
+     * @param bytesWrt New total bytes write.
+     */
+    public void bytesWritten(long bytesWrt) {
+        this.bytesWrt = bytesWrt;
+    }
+
+    /**
+     * @return Total bytes write time.
+     */
+    public long bytesWriteTime() {
+        return bytesWrtTm;
+    }
+
+    /**
+     * @param bytesWrtTm New total bytes write time.
+     */
+    public void bytesWriteTime(long bytesWrtTm) {
+        this.bytesWrtTm = bytesWrtTm;
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(VisorIgfsMetrics.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9b49a585/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfiler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfiler.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfiler.java
new file mode 100644
index 0000000..0de960a
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfiler.java
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 org.apache.ignite.internal.visor.igfs;
+
+import org.apache.ignite.igfs.*;
+import org.apache.ignite.internal.util.typedef.*;
+
+import java.util.*;
+
+/**
+ * Various global constants for GGFS profiler.
+ */
+public class VisorIgfsProfiler {
+    /** Default file block size to calculate uniformity. */
+    public static final int UNIFORMITY_DFLT_BLOCK_SIZE = 4096;
+
+    /** Default number of blocks to split file for uniformity calculations. */
+    public static final int UNIFORMITY_BLOCKS = 100;
+
+    /**
+     * Aggregate GGFS profiler entries.
+     *
+     * @param entries Entries to sum.
+     * @return Single aggregated entry.
+     */
+    public static VisorIgfsProfilerEntry aggregateGgfsProfilerEntries(List<VisorIgfsProfilerEntry> entries) {
+        assert !F.isEmpty(entries);
+
+        if (entries.size() == 1)
+            return entries.get(0); // No need to aggregate.
+        else {
+            String path = entries.get(0).path();
+
+            Collections.sort(entries, VisorIgfsProfilerEntry.ENTRY_TIMESTAMP_COMPARATOR);
+
+            long timestamp = 0;
+            long size = 0;
+            long bytesRead = 0;
+            long readTime = 0;
+            long userReadTime = 0;
+            long bytesWritten = 0;
+            long writeTime = 0;
+            long userWriteTime = 0;
+            IgfsMode mode = null;
+            VisorIgfsProfilerUniformityCounters counters = new VisorIgfsProfilerUniformityCounters();
+
+            for (VisorIgfsProfilerEntry entry : entries) {
+                // Take last timestamp.
+                timestamp = entry.timestamp();
+
+                // Take last size.
+                size = entry.size();
+
+                // Take last mode.
+                mode = entry.mode();
+
+                // Aggregate metrics.
+                bytesRead += entry.bytesRead();
+                readTime += entry.readTime();
+                userReadTime += entry.userReadTime();
+                bytesWritten += entry.bytesWritten();
+                writeTime += entry.writeTime();
+                userWriteTime += entry.userWriteTime();
+
+                counters.aggregate(entry.counters());
+            }
+
+            return new VisorIgfsProfilerEntry(path, timestamp, mode, size, bytesRead, readTime, userReadTime,
+                bytesWritten, writeTime, userWriteTime, counters);
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9b49a585/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerClearTask.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerClearTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerClearTask.java
new file mode 100644
index 0000000..b9a08b1
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerClearTask.java
@@ -0,0 +1,114 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 org.apache.ignite.internal.visor.igfs;
+
+import org.apache.ignite.*;
+import org.apache.ignite.internal.processors.task.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.internal.visor.*;
+import org.apache.ignite.lang.*;
+
+import java.io.*;
+import java.nio.file.*;
+
+import static org.apache.ignite.internal.visor.util.VisorTaskUtils.*;
+
+/**
+ * Remove all GGFS profiler logs.
+ */
+@GridInternal
+public class VisorIgfsProfilerClearTask extends VisorOneNodeTask<String, IgniteBiTuple<Integer, Integer>> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /**
+     * Job to clear profiler logs.
+     */
+    private static class VisorIgfsProfilerClearJob extends VisorJob<String, IgniteBiTuple<Integer, Integer>> {
+        /** */
+        private static final long serialVersionUID = 0L;
+
+        /**
+         * Create job with given argument.
+         *
+         * @param arg Job argument.
+         * @param debug Debug flag.
+         */
+        private VisorIgfsProfilerClearJob(String arg, boolean debug) {
+            super(arg, debug);
+        }
+
+        /** {@inheritDoc} */
+        @Override protected IgniteBiTuple<Integer, Integer> run(String arg) {
+            int deleted = 0;
+            int notDeleted = 0;
+
+            try {
+                IgniteFs ggfs = ignite.fileSystem(arg);
+
+                Path logsDir = resolveIgfsProfilerLogsDir(ggfs);
+
+                if (logsDir != null) {
+                    PathMatcher matcher = FileSystems.getDefault().getPathMatcher(
+                        "glob:igfs-log-" + arg + "-*.csv");
+
+                    try (DirectoryStream<Path> dirStream = Files.newDirectoryStream(logsDir)) {
+                        for (Path p : dirStream) {
+                            if (matcher.matches(p.getFileName())) {
+                                try {
+                                    Files.delete(p); // Try to delete file.
+
+                                    if (Files.exists(p)) // Checks if it still exists.
+                                        notDeleted++;
+                                    else
+                                        deleted++;
+                                }
+                                catch (NoSuchFileException ignored) {
+                                    // Files was already deleted, skip.
+                                }
+                                catch (IOException io) {
+                                    notDeleted++;
+
+                                    ignite.log().warning("Profiler log file was not deleted: " + p, io);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            catch (IOException | IllegalArgumentException e) {
+                throw new IgniteException("Failed to clear profiler logs for GGFS: " + arg, e);
+            }
+            catch (IgniteCheckedException e) {
+                throw U.convertException(e);
+            }
+
+            return new IgniteBiTuple<>(deleted, notDeleted);
+        }
+
+        /** {@inheritDoc} */
+        @Override public String toString() {
+            return S.toString(VisorIgfsProfilerClearJob.class, this);
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override protected VisorIgfsProfilerClearJob job(String arg) {
+        return new VisorIgfsProfilerClearJob(arg, debug);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9b49a585/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerEntry.java
new file mode 100644
index 0000000..4ec4975
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerEntry.java
@@ -0,0 +1,238 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 org.apache.ignite.internal.visor.igfs;
+
+import org.apache.ignite.igfs.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+
+import java.io.*;
+import java.util.*;
+
+/**
+ * Visor GGFS profiler information about one file.
+ */
+public class VisorIgfsProfilerEntry implements Serializable {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** Timestamp comparator. */
+    public static final Comparator<VisorIgfsProfilerEntry> ENTRY_TIMESTAMP_COMPARATOR =
+        new Comparator<VisorIgfsProfilerEntry>() {
+            @Override public int compare(VisorIgfsProfilerEntry a, VisorIgfsProfilerEntry b) {
+                return Long.compare(a.timestamp, b.timestamp);
+        }
+    };
+
+    /** Path to file. */
+    private final String path;
+
+    /** Timestamp of last file operation. */
+    private final long timestamp;
+
+    /** GGFS mode. */
+    private final IgfsMode mode;
+
+    /** File size. */
+    private final long size;
+
+    /** How many bytes were read. */
+    private final long bytesRead;
+
+    /** How long read take. */
+    private final long readTime;
+
+    /** User read time. */
+    private final long userReadTime;
+
+    /** How many bytes were written. */
+    private final long bytesWritten;
+
+    /** How long write take. */
+    private final long writeTime;
+
+    /** User write read time. */
+    private final long userWriteTime;
+
+    /** Calculated uniformity. */
+    private double uniformity = -1;
+
+    /** Counters for uniformity calculation.  */
+    private final VisorIgfsProfilerUniformityCounters counters;
+
+    /** Read speed in bytes per second or {@code -1} if speed not available. */
+    private final long readSpeed;
+
+    /** Write speed in bytes per second or {@code -1} if speed not available. */
+    private final long writeSpeed;
+
+    /** Create data transfer object with given parameters. */
+    public VisorIgfsProfilerEntry(
+        String path,
+        long timestamp,
+        IgfsMode mode,
+        long size,
+        long bytesRead,
+        long readTime,
+        long userReadTime,
+        long bytesWritten,
+        long writeTime,
+        long userWriteTime,
+        VisorIgfsProfilerUniformityCounters counters
+    ) {
+        assert counters != null;
+
+        this.path = path;
+        this.timestamp = timestamp;
+        this.mode = mode;
+        this.size = size;
+        this.bytesRead = bytesRead;
+        this.readTime = readTime;
+        this.userReadTime = userReadTime;
+        this.bytesWritten = bytesWritten;
+        this.writeTime = writeTime;
+        this.userWriteTime = userWriteTime;
+        this.counters = counters;
+
+        readSpeed = speed(bytesRead, readTime);
+        writeSpeed = speed(bytesWritten, writeTime);
+    }
+
+    /**
+     * Calculate speed of bytes processing.
+     *
+     * @param bytes How many bytes were processed.
+     * @param time How long processing take (in nanoseconds).
+     * @return Speed of processing in bytes per second or {@code -1} if speed not available.
+     */
+    private static long speed(long bytes, long time) {
+        if (time > 0) {
+            double bytesScaled = bytes * 100000d;
+            double timeScaled = time / 10000d;
+
+            return (long)(bytesScaled / timeScaled);
+        }
+        else
+            return -1L;
+    }
+
+    /**
+     * @return Path to file.
+     */
+    public String path() {
+        return path;
+    }
+
+    /**
+     * @return Timestamp of last file operation.
+     */
+    public long timestamp() {
+        return timestamp;
+    }
+
+    /**
+     * @return GGFS mode.
+     */
+    public IgfsMode mode() {
+        return mode;
+    }
+
+    /**
+     * @return File size.
+     */
+    public long size() {
+        return size;
+    }
+
+    /**
+     * @return How many bytes were read.
+     */
+    public long bytesRead() {
+        return bytesRead;
+    }
+
+    /**
+     * @return How long read take.
+     */
+    public long readTime() {
+        return readTime;
+    }
+
+    /**
+     * @return User read time.
+     */
+    public long userReadTime() {
+        return userReadTime;
+    }
+
+    /**
+     * @return How many bytes were written.
+     */
+    public long bytesWritten() {
+        return bytesWritten;
+    }
+
+    /**
+     * @return How long write take.
+     */
+    public long writeTime() {
+        return writeTime;
+    }
+
+    /**
+     * @return User write read time.
+     */
+    public long userWriteTime() {
+        return userWriteTime;
+    }
+
+    /**
+     * @return Calculated uniformity.
+     */
+    public double uniformity() {
+        if (uniformity < 0)
+            uniformity = counters.calc();
+
+        return uniformity;
+    }
+
+    /**
+     * @return Counters for uniformity calculation.
+     */
+    public VisorIgfsProfilerUniformityCounters counters() {
+        return counters;
+    }
+
+    /**
+     * @return Read speed in bytes per second or {@code -1} if speed not available.
+     */
+    public long readSpeed() {
+        return readSpeed;
+    }
+
+    /**
+     * @return Write speed in bytes per second or {@code -1} if speed not available.
+     */
+    public long writeSpeed() {
+        return writeSpeed;
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(VisorIgfsProfilerEntry.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9b49a585/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerTask.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerTask.java
new file mode 100644
index 0000000..6400f4b
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerTask.java
@@ -0,0 +1,507 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 org.apache.ignite.internal.visor.igfs;
+
+import org.apache.ignite.*;
+import org.apache.ignite.igfs.*;
+import org.apache.ignite.internal.processors.task.*;
+import org.apache.ignite.internal.util.typedef.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.internal.visor.*;
+
+import java.io.*;
+import java.nio.charset.*;
+import java.nio.file.*;
+import java.util.*;
+
+import static org.apache.ignite.internal.igfs.common.IgfsLogger.*;
+import static org.apache.ignite.internal.visor.util.VisorTaskUtils.*;
+
+/**
+ * Task that parse hadoop profiler logs.
+ */
+@GridInternal
+public class VisorIgfsProfilerTask extends VisorOneNodeTask<String, Collection<VisorIgfsProfilerEntry>> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /**
+     * Holder class for parsed data.
+     */
+    private static class VisorIgfsProfilerParsedLine {
+        /** Timestamp. */
+        private final long ts;
+
+        /** Log entry type. */
+        private final int entryType;
+
+        /** File path. */
+        private final String path;
+
+        /** File GGFS mode. */
+        private final IgfsMode mode;
+
+        /** Stream ID. */
+        private final long streamId;
+
+        /** Data length. */
+        private final long dataLen;
+
+        /** Overwrite flag. Available only for OPEN_OUT event. */
+        private final boolean overwrite;
+
+        /** Position of data being randomly read or seek. Available only for RANDOM_READ or SEEK events. */
+        private final long pos;
+
+        /** User time. Available only for CLOSE_IN/CLOSE_OUT events. */
+        private final long userTime;
+
+        /** System time (either read or write). Available only for CLOSE_IN/CLOSE_OUT events. */
+        private final long sysTime;
+
+        /** Total amount of read or written bytes. Available only for CLOSE_IN/CLOSE_OUT events.*/
+        private final long totalBytes;
+
+        /**
+         * Create holder for log line.
+         */
+        private VisorIgfsProfilerParsedLine(
+            long ts,
+            int entryType,
+            String path,
+            IgfsMode mode,
+            long streamId,
+            long dataLen,
+            boolean overwrite,
+            long pos,
+            long userTime,
+            long sysTime,
+            long totalBytes
+        ) {
+            this.ts = ts;
+            this.entryType = entryType;
+            this.path = path;
+            this.mode = mode;
+            this.streamId = streamId;
+            this.dataLen = dataLen;
+            this.overwrite = overwrite;
+            this.pos = pos;
+            this.userTime = userTime;
+            this.sysTime = sysTime;
+            this.totalBytes = totalBytes;
+        }
+    }
+
+    /**
+     * Comparator to sort parsed log lines by timestamp.
+     */
+    private static final Comparator<VisorIgfsProfilerParsedLine> PARSED_LINE_BY_TS_COMPARATOR =
+        new Comparator<VisorIgfsProfilerParsedLine>() {
+            @Override public int compare(VisorIgfsProfilerParsedLine a, VisorIgfsProfilerParsedLine b) {
+                return a.ts < b.ts ? -1
+                    : a.ts > b.ts ? 1
+                    : 0;
+            }
+    };
+
+    /**
+     * Job that do actual profiler work.
+     */
+    private static class VisorIgfsProfilerJob extends VisorJob<String, Collection<VisorIgfsProfilerEntry>> {
+        /** */
+        private static final long serialVersionUID = 0L;
+
+        // Named column indexes in log file.
+        private static final int LOG_COL_TIMESTAMP = 0;
+        private static final int LOG_COL_THREAD_ID = 1;
+        private static final int LOG_COL_ENTRY_TYPE = 3;
+        private static final int LOG_COL_PATH = 4;
+        private static final int LOG_COL_GGFS_MODE = 5;
+        private static final int LOG_COL_STREAM_ID = 6;
+        private static final int LOG_COL_DATA_LEN = 8;
+        private static final int LOG_COL_OVERWRITE = 10;
+        private static final int LOG_COL_POS = 13;
+        private static final int LOG_COL_USER_TIME = 17;
+        private static final int LOG_COL_SYSTEM_TIME = 18;
+        private static final int LOG_COL_TOTAL_BYTES = 19;
+
+        /** List of log entries that should be parsed. */
+        private static final Set<Integer> LOG_TYPES = F.asSet(
+            TYPE_OPEN_IN,
+            TYPE_OPEN_OUT,
+            TYPE_RANDOM_READ,
+            TYPE_CLOSE_IN,
+            TYPE_CLOSE_OUT
+        );
+
+        /**
+         * Create job with given argument.
+         *
+         * @param arg GGFS name.
+         * @param debug Debug flag.
+         */
+        private VisorIgfsProfilerJob(String arg, boolean debug) {
+            super(arg, debug);
+        }
+
+        /** {@inheritDoc} */
+        @Override protected Collection<VisorIgfsProfilerEntry> run(String arg) {
+            try {
+                Path logsDir = resolveIgfsProfilerLogsDir(ignite.fileSystem(arg));
+
+                if (logsDir != null)
+                    return parse(logsDir, arg);
+                else
+                    return Collections.emptyList();
+            }
+            catch (IOException | IllegalArgumentException e) {
+                throw new IgniteException("Failed to parse profiler logs for GGFS: " + arg, e);
+            }
+            catch (IgniteCheckedException e) {
+                throw U.convertException(e);
+            }
+        }
+
+        /**
+         * Parse boolean.
+         *
+         * @param ss Array of source strings.
+         * @param ix Index of array item to parse.
+         * @return Parsed boolean.
+         */
+        private boolean parseBoolean(String[] ss, int ix) {
+            return ix < ss.length && "1".equals(ss[ix]);
+        }
+
+        /**
+         * Parse integer.
+         *
+         * @param ss Array of source strings.
+         * @param ix Index of array item to parse.
+         * @param dflt Default value if string is empty or index is out of array bounds.
+         * @return Parsed integer.
+         * @exception NumberFormatException  if the string does not contain a parsable integer.
+         */
+        private int parseInt(String[] ss, int ix, int dflt) {
+            if (ss.length <= ix)
+                return dflt;
+            else {
+                String s = ss[ix];
+
+                return s.isEmpty() ? dflt : Integer.parseInt(s);
+            }
+        }
+
+        /**
+         * Parse long.
+         *
+         * @param ss Array of source strings.
+         * @param ix Index of array item to parse.
+         * @param dflt Default value if string is empty or index is out of array bounds.
+         * @return Parsed integer.
+         * @exception NumberFormatException if the string does not contain a parsable long.
+         */
+        private long parseLong(String[] ss, int ix, long dflt) {
+            if (ss.length <= ix)
+                return dflt;
+            else {
+                String s = ss[ix];
+
+                return s.isEmpty() ? dflt : Long.parseLong(s);
+            }
+        }
+
+        /**
+         * Parse string.
+         *
+         * @param ss Array of source strings.
+         * @param ix Index of array item to parse.
+         * @return Parsed string.
+         */
+        private String parseString(String[] ss, int ix) {
+            if (ss.length <= ix)
+                return "";
+            else {
+                String s = ss[ix];
+
+                return s.isEmpty() ? "" : s;
+            }
+        }
+
+        /**
+         * Parse GGFS mode from string.
+         *
+         * @param ss Array of source strings.
+         * @param ix Index of array item to parse.
+         * @return Parsed GGFS mode or {@code null} if string is empty.
+         */
+        private IgfsMode parseGgfsMode(String[] ss, int ix) {
+            if (ss.length <= ix)
+                return null;
+            else {
+                String s = ss[ix];
+
+                return s.isEmpty() ? null : IgfsMode.valueOf(s);
+            }
+        }
+
+        /**
+         * Parse line from log.
+         *
+         * @param s Line with text to parse.
+         * @return Parsed data.
+         */
+        private VisorIgfsProfilerParsedLine parseLine(String s) {
+            String[] ss = s.split(DELIM_FIELD);
+
+            long streamId = parseLong(ss, LOG_COL_STREAM_ID, -1);
+
+            if (streamId >= 0) {
+                int entryType = parseInt(ss, LOG_COL_ENTRY_TYPE, -1);
+
+                // Parse only needed types.
+                if (LOG_TYPES.contains(entryType))
+                    return new VisorIgfsProfilerParsedLine(
+                        parseLong(ss, LOG_COL_TIMESTAMP, 0),
+                        entryType,
+                        parseString(ss, LOG_COL_PATH),
+                        parseGgfsMode(ss, LOG_COL_GGFS_MODE),
+                        streamId,
+                        parseLong(ss, LOG_COL_DATA_LEN, 0),
+                        parseBoolean(ss, LOG_COL_OVERWRITE),
+                        parseLong(ss, LOG_COL_POS, 0),
+                        parseLong(ss, LOG_COL_USER_TIME, 0),
+                        parseLong(ss, LOG_COL_SYSTEM_TIME, 0),
+                        parseLong(ss, LOG_COL_TOTAL_BYTES, 0)
+                    );
+            }
+
+            return null;
+        }
+
+        /**
+         * Aggregate information from parsed lines grouped by {@code streamId}.
+         */
+        private VisorIgfsProfilerEntry aggregateParsedLines(List<VisorIgfsProfilerParsedLine> lines) {
+            VisorIgfsProfilerUniformityCounters counters = new VisorIgfsProfilerUniformityCounters();
+
+            Collections.sort(lines, PARSED_LINE_BY_TS_COMPARATOR);
+
+            String path = "";
+            long ts = 0;
+            long size = 0;
+            long bytesRead = 0;
+            long readTime = 0;
+            long userReadTime = 0;
+            long bytesWritten = 0;
+            long writeTime = 0;
+            long userWriteTime = 0;
+            IgfsMode mode = null;
+
+            for (VisorIgfsProfilerParsedLine line : lines) {
+                if (!line.path.isEmpty())
+                    path = line.path;
+
+                ts = line.ts; // Remember last timestamp.
+
+                // Remember last GGFS mode.
+                if (line.mode != null)
+                    mode = line.mode;
+
+                switch (line.entryType) {
+                    case TYPE_OPEN_IN:
+                        size = line.dataLen; // Remember last file size.
+
+                        counters.invalidate(size);
+                        break;
+
+                    case TYPE_OPEN_OUT:
+                        if (line.overwrite) {
+                            size = 0; // If file was overridden, set size to zero.
+
+                            counters.invalidate(size);
+                        }
+                        break;
+
+                    case TYPE_CLOSE_IN:
+                        bytesRead += line.totalBytes; // Add to total bytes read.
+                        readTime += line.sysTime; // Add to read time.
+                        userReadTime += line.userTime; // Add to user read time.
+
+                        counters.increment(line.pos, line.totalBytes);
+
+                        break;
+
+                    case TYPE_CLOSE_OUT:
+                        size += line.totalBytes; // Add to files size.
+                        bytesWritten += line.totalBytes; // Add to total bytes written.
+                        writeTime += line.sysTime; // Add to write time.
+                        userWriteTime += line.userTime; // Add to user write time.
+
+                        counters.invalidate(size);
+
+                        break;
+
+                    case TYPE_RANDOM_READ:
+                        counters.increment(line.pos, line.totalBytes);
+
+                        break;
+
+                    default:
+                        throw new IllegalStateException("Unexpected GGFS profiler log entry type: " + line.entryType);
+                }
+            }
+
+            // Return only fully parsed data with path.
+            return path.isEmpty() ? null :
+                new VisorIgfsProfilerEntry(
+                    path,
+                    ts,
+                    mode,
+                    size,
+                    bytesRead,
+                    readTime,
+                    userReadTime,
+                    bytesWritten,
+                    writeTime,
+                    userWriteTime,
+                    counters);
+        }
+
+        /**
+         * @param p Path to log file to parse.
+         * @return Collection of parsed and aggregated entries.
+         * @throws IOException if failed to read log file.
+         */
+        private Collection<VisorIgfsProfilerEntry> parseFile(Path p) throws IOException {
+            Collection<VisorIgfsProfilerParsedLine> parsedLines = new ArrayList<>(512);
+
+            try (BufferedReader br = Files.newBufferedReader(p, Charset.forName("UTF-8"))) {
+                String line = br.readLine(); // Skip first line with columns header.
+
+                if (line != null) {
+                    // Check file header.
+                    if (line.equalsIgnoreCase(HDR))
+                        line = br.readLine();
+
+                        while (line != null) {
+                            try {
+                                VisorIgfsProfilerParsedLine ln = parseLine(line);
+
+                                if (ln != null)
+                                    parsedLines.add(ln);
+                            }
+                            catch (NumberFormatException ignored) {
+                                // Skip invalid lines.
+                            }
+
+                            line = br.readLine();
+                        }
+                }
+            }
+
+            // Group parsed lines by streamId.
+            Map<Long, List<VisorIgfsProfilerParsedLine>> byStreamId = new HashMap<>();
+
+            for (VisorIgfsProfilerParsedLine line: parsedLines) {
+                List<VisorIgfsProfilerParsedLine> grp = byStreamId.get(line.streamId);
+
+                if (grp == null) {
+                    grp = new ArrayList<>();
+
+                    byStreamId.put(line.streamId, grp);
+                }
+
+                grp.add(line);
+            }
+
+            // Aggregate each group.
+            Collection<VisorIgfsProfilerEntry> entries = new ArrayList<>(byStreamId.size());
+
+            for (List<VisorIgfsProfilerParsedLine> lines : byStreamId.values()) {
+                VisorIgfsProfilerEntry entry = aggregateParsedLines(lines);
+
+                if (entry != null)
+                    entries.add(entry);
+            }
+
+            // Group by files.
+            Map<String, List<VisorIgfsProfilerEntry>> byPath = new HashMap<>();
+
+            for (VisorIgfsProfilerEntry entry: entries) {
+                List<VisorIgfsProfilerEntry> grp = byPath.get(entry.path());
+
+                if (grp == null) {
+                    grp = new ArrayList<>();
+
+                    byPath.put(entry.path(), grp);
+                }
+
+                grp.add(entry);
+            }
+
+            // Aggregate by files.
+            Collection<VisorIgfsProfilerEntry> res = new ArrayList<>(byPath.size());
+
+            for (List<VisorIgfsProfilerEntry> lst : byPath.values())
+                res.add(VisorIgfsProfiler.aggregateGgfsProfilerEntries(lst));
+
+            return res;
+        }
+
+        /**
+         * Parse all GGFS log files in specified log directory.
+         *
+         * @param logDir Folder were log files located.
+         * @return List of line with aggregated information by files.
+         */
+        private Collection<VisorIgfsProfilerEntry> parse(Path logDir, String ggfsName) throws IOException {
+            Collection<VisorIgfsProfilerEntry> parsedFiles = new ArrayList<>(512);
+
+            try (DirectoryStream<Path> dirStream = Files.newDirectoryStream(logDir)) {
+                PathMatcher matcher = FileSystems.getDefault().getPathMatcher("glob:igfs-log-" + ggfsName + "-*.csv");
+
+                for (Path p : dirStream) {
+                    if (matcher.matches(p.getFileName())) {
+                        try {
+                            parsedFiles.addAll(parseFile(p));
+                        }
+                        catch (NoSuchFileException ignored) {
+                            // Files was deleted, skip it.
+                        }
+                        catch (Exception e) {
+                            ignite.log().warning("Failed to parse GGFS profiler log file: " + p, e);
+                        }
+                    }
+                }
+            }
+
+            return parsedFiles;
+        }
+
+        /** {@inheritDoc} */
+        @Override public String toString() {
+            return S.toString(VisorIgfsProfilerJob.class, this);
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override protected VisorIgfsProfilerJob job(String arg) {
+        return new VisorIgfsProfilerJob(arg, debug);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9b49a585/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerUniformityCounters.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerUniformityCounters.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerUniformityCounters.java
new file mode 100644
index 0000000..5efea02
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerUniformityCounters.java
@@ -0,0 +1,197 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 org.apache.ignite.internal.visor.igfs;
+
+import org.apache.ignite.internal.util.typedef.*;
+
+import java.io.*;
+import java.util.*;
+
+import static org.apache.ignite.internal.visor.igfs.VisorIgfsProfiler.*;
+
+/**
+ * Class to support uniformity calculation.
+ *
+ * <a href="http://en.wikipedia.org/wiki/Coefficient_of_variation">
+ * Uniformity calculated as coefficient of variation.
+ * </a>
+ *
+ * Count read frequency for each file and compare with ideal uniform distribution.
+ */
+public class VisorIgfsProfilerUniformityCounters implements Serializable {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** Analyzed file size in bytes. */
+    private long fileSize = 0;
+
+    /** Current block size to calculate uniformity. */
+    private long blockSize = UNIFORMITY_DFLT_BLOCK_SIZE;
+
+    private ArrayList<Integer> counters = new ArrayList<>();
+
+    private long calcBlockSize(long fileSize) {
+        return Math.max(UNIFORMITY_DFLT_BLOCK_SIZE, fileSize / UNIFORMITY_BLOCKS);
+    }
+
+    /**
+     * Check if counters and blockSize should be adjusted according to file size.
+     *
+     * @param newFileSize New size of file.
+     */
+    public void invalidate(long newFileSize) {
+        if (newFileSize < fileSize) { // If newFileSize is less than current fileSize then clear counters.
+            fileSize = newFileSize;
+
+            counters.clear();
+
+            blockSize = calcBlockSize(fileSize);
+        }
+        else if (newFileSize > fileSize) // If newFileSize is bigger then current fileSize then adjust counters and blockSize.
+            compact(newFileSize);
+    }
+
+    /**
+     * Perform compacting counters if {@code newBlockSize} is great more than twice then compact previous counters.
+     *
+     * @param newFileSize New file size to check.
+     */
+    private void compact(long newFileSize) {
+        long newBlockSize = calcBlockSize(newFileSize);
+
+        if (counters.isEmpty())
+            blockSize = newBlockSize;
+        else {
+            if (newBlockSize >= 2 * blockSize) {
+                int ratio = (int)(newBlockSize / blockSize);
+
+                ArrayList<Integer> compacted = new ArrayList<>();
+
+                int sum = 0;
+                int cnt = 0;
+
+                for (Integer counter : counters) {
+                    sum += counter;
+                    cnt++;
+
+                    if (cnt >= ratio) {
+                        compacted.add(sum);
+
+                        sum = 0;
+                        cnt = 0;
+                    }
+                }
+
+                if (sum > 0)
+                    compacted.add(sum);
+
+                counters.clear();
+                counters.addAll(compacted);
+
+                blockSize = newBlockSize;
+            }
+        }
+
+        fileSize = newFileSize;
+    }
+
+    /**
+     * Ensure counters capacity and initial state.
+     *
+     * @param minCapacity Desired minimum capacity.
+     */
+    private void capacity(int minCapacity) {
+        counters.ensureCapacity(minCapacity);
+
+        while(counters.size() < minCapacity)
+            counters.add(0);
+    }
+
+    /**
+     * Increment counters by given pos and length.
+     *
+     * @param pos Position in file.
+     * @param len Read data length.
+     */
+    public void increment(long pos, long len) {
+        int blockFrom = (int)(pos / blockSize);
+        int blockTo = (int)((pos + len) / blockSize) + 1;
+
+        capacity(blockTo);
+
+        for (int i = blockFrom; i < blockTo; i++)
+            counters.set(i, counters.get(i) + 1);
+    }
+
+    /**
+     * Add given counters.
+     *
+     * @param other Counters to add.
+     */
+    public void aggregate(VisorIgfsProfilerUniformityCounters other) {
+        if (fileSize < other.fileSize)
+            compact(other.fileSize);
+        else if (fileSize > other.fileSize)
+            other.compact(fileSize);
+
+        int cnt = other.counters.size();
+
+        if (counters.size() < cnt)
+            capacity(cnt);
+
+        for (int i = 0; i < cnt; i++)
+            counters.set(i, counters.get(i) + other.counters.get(i));
+    }
+
+    /**
+     * Calculate uniformity as standard deviation.
+     * See: http://en.wikipedia.org/wiki/Standard_deviation.
+     *
+     * @return Uniformity value as number in {@code 0..1} range.
+     */
+    public double calc() {
+        if (counters.isEmpty())
+            return -1;
+        else {
+            int cap = (int) (fileSize / blockSize + (fileSize % blockSize > 0 ? 1 : 0));
+
+            capacity(cap);
+
+            int sz = counters.size();
+
+            int n = F.sumInt(counters);
+
+            double mean = 1.0 / sz;
+
+            // Calc standard deviation for block read frequency: SQRT(SUM(Freq_i - Mean)^2 / K)
+            // where Mean = 1 / K
+            //       K - Number of blocks
+            //       Freq_i = Counter_i / N
+            //       N - Sum of all counters
+            double sigma = 0;
+
+            for (Integer counter : counters)
+                sigma += Math.pow(counter.doubleValue() / n - mean, 2);
+
+            sigma = Math.sqrt(sigma / sz);
+
+            // Calc uniformity coefficient.
+            return 1.0 - sigma;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9b49a585/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsResetMetricsTask.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsResetMetricsTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsResetMetricsTask.java
new file mode 100644
index 0000000..db9f07f
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsResetMetricsTask.java
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 org.apache.ignite.internal.visor.igfs;
+
+import org.apache.ignite.*;
+import org.apache.ignite.internal.processors.task.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.internal.visor.*;
+
+import java.util.*;
+
+/**
+ * Resets GGFS metrics.
+ */
+@GridInternal
+public class VisorIgfsResetMetricsTask extends VisorOneNodeTask<Set<String>, Void> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** {@inheritDoc} */
+    @Override protected VisorIgfsResetMetricsJob job(Set<String> arg) {
+        return new VisorIgfsResetMetricsJob(arg, debug);
+    }
+
+    /**
+     * Job that reset GGFS metrics.
+     */
+    private static class VisorIgfsResetMetricsJob extends VisorJob<Set<String>, Void> {
+        /** */
+        private static final long serialVersionUID = 0L;
+
+        /**
+         * @param arg GGFS names.
+         * @param debug Debug flag.
+         */
+        private VisorIgfsResetMetricsJob(Set<String> arg, boolean debug) {
+            super(arg, debug);
+        }
+
+        /** {@inheritDoc} */
+        @Override protected Void run(Set<String> ggfsNames) {
+            for (String ggfsName: ggfsNames)
+                try {
+                    ignite.fileSystem(ggfsName).resetMetrics();
+                }
+                catch (IllegalArgumentException iae) {
+                    throw new IgniteException("Failed to reset metrics for GGFS: " + ggfsName, iae);
+                }
+
+            return null;
+        }
+
+        /** {@inheritDoc} */
+        @Override public String toString() {
+            return S.toString(VisorIgfsResetMetricsJob.class, this);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9b49a585/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsSamplingStateTask.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsSamplingStateTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsSamplingStateTask.java
new file mode 100644
index 0000000..1f98c47
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsSamplingStateTask.java
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 org.apache.ignite.internal.visor.igfs;
+
+import org.apache.ignite.*;
+import org.apache.ignite.internal.processors.igfs.*;
+import org.apache.ignite.internal.processors.task.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.internal.visor.*;
+import org.apache.ignite.lang.*;
+
+/**
+ * Task to set GGFS instance sampling state.
+ */
+@GridInternal
+public class VisorIgfsSamplingStateTask extends VisorOneNodeTask<IgniteBiTuple<String, Boolean>, Void> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /**
+     * Job that perform parsing of GGFS profiler logs.
+     */
+    private static class VisorIgfsSamplingStateJob extends VisorJob<IgniteBiTuple<String, Boolean>, Void> {
+        /** */
+        private static final long serialVersionUID = 0L;
+
+        /**
+         * Create job with given argument.
+         *
+         * @param arg Job argument.
+         * @param debug Debug flag.
+         */
+        public VisorIgfsSamplingStateJob(IgniteBiTuple<String, Boolean> arg, boolean debug) {
+            super(arg, debug);
+        }
+
+        /** {@inheritDoc} */
+        @Override protected Void run(IgniteBiTuple<String, Boolean> arg) {
+            try {
+                ((IgfsEx)ignite.fileSystem(arg.get1())).globalSampling(arg.get2());
+
+                return null;
+            }
+            catch (IllegalArgumentException iae) {
+                throw new IgniteException("Failed to set sampling state for GGFS: " + arg.get1(), iae);
+            }
+            catch(IgniteCheckedException e) {
+                throw U.convertException(e);
+            }
+        }
+
+        /** {@inheritDoc} */
+        @Override public String toString() {
+            return S.toString(VisorIgfsSamplingStateJob.class, this);
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override protected VisorIgfsSamplingStateJob job(IgniteBiTuple<String, Boolean> arg) {
+        return new VisorIgfsSamplingStateJob(arg, debug);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9b49a585/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorJob.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorJob.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorJob.java
index 33174ab..65a9d44 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorJob.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorJob.java
@@ -28,7 +28,7 @@ import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.internal.visor.*;
 import org.apache.ignite.internal.visor.cache.*;
 import org.apache.ignite.internal.visor.compute.*;
-import org.apache.ignite.internal.visor.ggfs.*;
+import org.apache.ignite.internal.visor.igfs.*;
 import org.apache.ignite.internal.visor.streamer.*;
 import org.apache.ignite.streamer.*;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9b49a585/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorJobResult.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorJobResult.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorJobResult.java
index cede987..a07232b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorJobResult.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorJobResult.java
@@ -19,7 +19,7 @@ package org.apache.ignite.internal.visor.node;
 
 import org.apache.ignite.internal.visor.cache.*;
 import org.apache.ignite.internal.visor.event.*;
-import org.apache.ignite.internal.visor.ggfs.*;
+import org.apache.ignite.internal.visor.igfs.*;
 import org.apache.ignite.internal.visor.streamer.*;
 
 import java.io.*;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9b49a585/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorTaskResult.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorTaskResult.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorTaskResult.java
index 1943c47..b63f531 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorTaskResult.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorTaskResult.java
@@ -19,7 +19,7 @@ package org.apache.ignite.internal.visor.node;
 
 import org.apache.ignite.internal.visor.cache.*;
 import org.apache.ignite.internal.visor.event.*;
-import org.apache.ignite.internal.visor.ggfs.*;
+import org.apache.ignite.internal.visor.igfs.*;
 import org.apache.ignite.internal.visor.streamer.*;
 
 import java.io.*;


Mime
View raw message