<commit_before>all: test target/release/request_log_analyzer

target/release/request_log_analyzer: src/
	cargo build --release --verbose

test:
	cargo test --verbose

test-no-run:
	cargo test --no-run

perf: src/test/random-small.log src/test/random-big.log
	src/test/perf_test

target/perf/%.csv: target/release/archive/%
	mkdir -p target/perf
	src/test/perf_test_binary $< src/test/request.log.2016-04-06-Pub2-fixed > $@

target/release/archive/%:
	git checkout $(shell basename $@)
	cargo build --release
	cp target/release/request_log_analyzer $@

coverage: test-no-run
# Example file name: request_log_analyzer-751ef51155a898c3
# We are interested in the test binaries with a hash postfix
# In this case, we simply look for the dash that separates the postfix...
	$(eval LATEST_TEST_BINARY := $(shell ls target/debug/*-* -t1 | head -1))
# http://sunjay.ca/2016/07/25/rust-code-coverage
	kcov --exclude-pattern=/.cargo,/usr/lib --verify target/cov $(LATEST_TEST_BINARY)

src/test/random-small.log:
	python src/test/generate_random_log.py 1000 > src/test/random-small.log

src/test/random-big.log:
	python src/test/generate_random_log.py 600000 > src/test/random-big.log
<commit_msg>Go back to main branch via git<commit_after>all: test target/release/request_log_analyzer

target/release/request_log_analyzer: src/
	cargo build --release --verbose

test:
	cargo test --verbose

test-no-run:
	cargo test --no-run

perf: src/test/random-small.log src/test/random-big.log
	src/test/perf_test

target/perf/%.csv: target/release/archive/%
	mkdir -p target/perf
	src/test/perf_test_binary $< src/test/request.log.2016-04-06-Pub2-fixed > $@

target/release/archive/%:
	git checkout $(shell basename $@)
	cargo build --release
	git checkout performance-analysis
	cp target/release/request_log_analyzer $@

coverage: test-no-run
# Example file name: request_log_analyzer-751ef51155a898c3
# We are interested in the test binaries with a hash postfix
# In this case, we simply look for the dash that separates the postfix...
	$(eval LATEST_TEST_BINARY := $(shell ls target/debug/*-* -t1 | head -1))
# http://sunjay.ca/2016/07/25/rust-code-coverage
	kcov --exclude-pattern=/.cargo,/usr/lib --verify target/cov $(LATEST_TEST_BINARY)

src/test/random-small.log:
	python src/test/generate_random_log.py 1000 > src/test/random-small.log

src/test/random-big.log:
	python src/test/generate_random_log.py 600000 > src/test/random-big.log

{'fraction_non_alphanumeric': 0.12912541254125412, 'fraction_numerical': 0.03382838283828383, 'mean_word_length': 4.137711864406779, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '149488', 'n_tokens_mistral': 931, 'n_tokens_neox': 853, 'n_words': 193}