aboutsummaryrefslogtreecommitdiffstats
path: root/config-model/src/test/java/com/yahoo/schema/derived/NuwaTestCase.java
blob: 4f30169713acdc95484c78477d78a2e313175f40 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.schema.derived;

import com.yahoo.schema.parser.ParseException;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

import java.io.IOException;

/**
 * A real world mlr ranking model, useful to benchmark memory and cpu usage.
 * 
 * @author bratseth
 */
public class NuwaTestCase extends AbstractExportingTestCase {

    @Test
    @Disabled
    void testNuwa() throws IOException, ParseException {
        System.gc();
        long freeBytesBefore = Runtime.getRuntime().freeMemory();
        long totalBytesBefore = Runtime.getRuntime().totalMemory();

        DerivedConfiguration configuration = assertCorrectDeriving("nuwa");

        System.gc();
        long freeBytesAfter = Runtime.getRuntime().freeMemory();
        long totalBytesAfter = Runtime.getRuntime().totalMemory();
        long additionalAllocated = totalBytesAfter - totalBytesBefore;
        System.out.println("Consumed " + ((freeBytesBefore - (freeBytesAfter - additionalAllocated)) / 1000000) + " Mb");
    }

}