Remove MemoryConsumption 93/108493/1
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 18 Oct 2023 07:05:44 +0000 (09:05 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 18 Oct 2023 07:06:18 +0000 (09:06 +0200)
This class is not used anywhere, remove it.

Change-Id: I8fcaa8db98a5cd266d4c8c10d983b98c3327485b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
data/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/MemoryConsumption.java [deleted file]

diff --git a/data/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/MemoryConsumption.java b/data/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/MemoryConsumption.java
deleted file mode 100644 (file)
index 7d416ce..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.data.impl;
-
-/**
- * Provides memory consumption and elapsed time between 2 points.
- *
- * @author mirehak
- */
-public class MemoryConsumption {
-    private long memBegin;
-    private long tsBegin;
-
-    /**
-     * Record memory and timestamp.
-     */
-    public void startObserving() {
-        Runtime runtime = Runtime.getRuntime();
-        // Run the garbage collector
-        runtime.gc();
-        memBegin = getActualMemoryConsumption();
-        tsBegin = System.currentTimeMillis();
-    }
-
-    /**
-     * Return memory usage and elapsed time message.
-     *
-     * @return memory usage and time elapsed message
-     */
-    public String finishObserving() {
-        long memEnd = getActualMemoryConsumption();
-        long tsEnd = System.currentTimeMillis();
-        return String.format("Used memory: %10d B; Elapsed time: %5d ms", memEnd - memBegin, tsEnd - tsBegin);
-    }
-
-    /**
-     * Return used memory.
-     *
-     * @return actual memory usage
-     */
-    public static long getActualMemoryConsumption() {
-        Runtime runtime = Runtime.getRuntime();
-        // Calculate the used memory
-        long memory = runtime.totalMemory() - runtime.freeMemory();
-        return memory;
-    }
-}