Package redis.clients.johm.benchmark

Source Code of redis.clients.johm.benchmark.SaveSearchBenchmark

package redis.clients.johm.benchmark;

import org.junit.Test;

import redis.clients.johm.JOhm;
import redis.clients.johm.models.User;

public class SaveSearchBenchmark extends JOhmBenchmarkTestBase {
    @Test
    public void saveSearchModel() {
        int totalOps = 5000;
        timer.begin();
        User user = null;
        for (int n = 0; n < totalOps; n++) {
            user = new User();
            user.setName("foo" + n);
            user.setRoom("vroom" + n);
            user.setAge(n);
            user.setSalary(9999.99f);
            user.setInitial('f');
            JOhm.save(user);
            JOhm.find(User.class, "name", "foo" + n);
            JOhm.find(User.class, "age", n);
        }
        timer.end();
        printStats("saveSearchModel", totalOps, 3, timer.elapsed());
    }
}
TOP

Related Classes of redis.clients.johm.benchmark.SaveSearchBenchmark

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.