Project

General

Profile

« Previous | Next » 

Revision 46816

checking how long it takes to transform

View differences:

modules/dnet-msro-service/branches/saxonHE/src/main/java/eu/dnetlib/msro/workflows/nodes/transform/X3MTransformJobNode.java
83 83
		return Arc.DEFAULT_ARC;
84 84
	}
85 85

  
86
	private String buildXML(String header, String transformationDate, String metadata, String provenance) {
86
	protected String buildXML(String header, String transformationDate, String metadata, String provenance) {
87 87
		try {
88 88
			XMLIndenter xmlHelper = new XMLIndenter();
89 89
			DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
modules/dnet-msro-service/branches/saxonHE/src/main/java/eu/dnetlib/msro/workflows/nodes/transform/ApplyX3Mapping.java
30 30

  
31 31
	@Override
32 32
	public String apply(final String metadata) {
33
		//LocalDateTime config = LocalDateTime.now();
33 34
		try (InputStream mappingStream = getStream(mapping);
34 35
				InputStream policyStream = getStream(generatorPolicy);
35 36
				InputStream metadataStream = getStream(metadata);
36 37
				final ByteArrayOutputStream os = new ByteArrayOutputStream()){
37 38
			X3MLEngineFactory x3mEngineFactory = getConfiguredX3MEngineFactory(mappingStream, policyStream);
38 39
			x3mEngineFactory.withInput(metadataStream).withOutput(os, OutputFormat.RDF_XML);
40
			//LocalDateTime start = LocalDateTime.now();
39 41
			x3mEngineFactory.execute();
42
			//LocalDateTime end = LocalDateTime.now();
43
//			System.out.println("Config set in "+ Duration.between(config, start).toMillis()+"ms");
44
//			System.out.println("Transformation took "+ Duration.between(start, end).toMillis()+"ms");
40 45
			return new String(os.toByteArray());
41 46
		} catch (Exception e) {
42 47
			throw new RuntimeException(e);

Also available in: Unified diff