summaryrefslogtreecommitdiffstats
path: root/config-model/src/test/java/com/yahoo/searchdefinition/derived/NuwaTestCase.java
blob: f852b8444abf05244b38260d905633110a0190f4 (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 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.searchdefinition.derived;

import com.yahoo.searchdefinition.parser.ParseException;
import org.junit.Ignore;
import org.junit.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
    @Ignore
    public 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");
    }

}