From common-commits-return-82240-archive-asf-public=cust-asf.ponee.io@hadoop.apache.org Wed May 2 21:55:09 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 2A0A618065D for ; Wed, 2 May 2018 21:55:09 +0200 (CEST) Received: (qmail 13469 invoked by uid 500); 2 May 2018 19:55:07 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 13460 invoked by uid 99); 2 May 2018 19:55:07 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 May 2018 19:55:07 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id C371EE028C; Wed, 2 May 2018 19:55:07 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: aengineer@apache.org To: common-commits@hadoop.apache.org Message-Id: <99d2ce492dc84999aefa26614bf826c4@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: hadoop git commit: HDDS-15. Add memory profiler support to Genesis. Contributed by Anu Engineer. Date: Wed, 2 May 2018 19:55:07 +0000 (UTC) Repository: hadoop Updated Branches: refs/heads/trunk 3b34fca4b -> 6b63a0af9 HDDS-15. Add memory profiler support to Genesis. Contributed by Anu Engineer. Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/6b63a0af Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/6b63a0af Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/6b63a0af Branch: refs/heads/trunk Commit: 6b63a0af9b29c231166d9af50d499a246cbbb755 Parents: 3b34fca Author: Anu Engineer Authored: Wed May 2 10:44:47 2018 -0700 Committer: Anu Engineer Committed: Wed May 2 12:54:49 2018 -0700 ---------------------------------------------------------------------- .../apache/hadoop/ozone/genesis/Genesis.java | 7 ++- .../ozone/genesis/GenesisMemoryProfiler.java | 59 ++++++++++++++++++++ 2 files changed, 65 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/6b63a0af/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/genesis/Genesis.java ---------------------------------------------------------------------- diff --git a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/genesis/Genesis.java b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/genesis/Genesis.java index 5efa12a..0dc3db7 100644 --- a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/genesis/Genesis.java +++ b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/genesis/Genesis.java @@ -42,9 +42,12 @@ public final class Genesis { .include(BenchMarkMetadataStoreReads.class.getSimpleName()) .include(BenchMarkMetadataStoreWrites.class.getSimpleName()) .include(BenchMarkDatanodeDispatcher.class.getSimpleName()) - .include(BenchMarkRocksDbStore.class.getSimpleName()) +// Commenting this test out, till we support either a command line or a config + // file based ability to run tests. +// .include(BenchMarkRocksDbStore.class.getSimpleName()) .warmupIterations(5) .measurementIterations(20) + .addProfiler(GenesisMemoryProfiler.class) .shouldDoGC(true) .forks(1) .build(); @@ -52,3 +55,5 @@ public final class Genesis { new Runner(opt).run(); } } + + http://git-wip-us.apache.org/repos/asf/hadoop/blob/6b63a0af/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/genesis/GenesisMemoryProfiler.java ---------------------------------------------------------------------- diff --git a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/genesis/GenesisMemoryProfiler.java b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/genesis/GenesisMemoryProfiler.java new file mode 100644 index 0000000..090f1a7 --- /dev/null +++ b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/genesis/GenesisMemoryProfiler.java @@ -0,0 +1,59 @@ +/* + * 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.hadoop.ozone.genesis; + +import org.openjdk.jmh.infra.BenchmarkParams; +import org.openjdk.jmh.infra.IterationParams; +import org.openjdk.jmh.profile.InternalProfiler; +import org.openjdk.jmh.results.AggregationPolicy; +import org.openjdk.jmh.results.IterationResult; +import org.openjdk.jmh.results.Result; +import org.openjdk.jmh.results.ScalarResult; + +import java.util.ArrayList; +import java.util.Collection; + +/** + * Max memory profiler. + */ +public class GenesisMemoryProfiler implements InternalProfiler { + @Override + public void beforeIteration(BenchmarkParams benchmarkParams, + IterationParams iterationParams) { + + } + + @Override + public Collection afterIteration(BenchmarkParams + benchmarkParams, IterationParams iterationParams, IterationResult + result) { + long totalHeap = Runtime.getRuntime().totalMemory(); + + Collection samples = new ArrayList<>(); + samples.add(new ScalarResult("Max heap", totalHeap, "bytes", + AggregationPolicy.MAX)); + return samples; + } + + @Override + public String getDescription() { + return "Genesis Memory Profiler. Computes Max Memory used by a test."; + } +} + --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org For additional commands, e-mail: common-commits-help@hadoop.apache.org