Sha256: 509972d59690df430c0958266dd55411e849cd59e118d3e1ab41cfb57a812702

Contents?: true

Size: 516 Bytes

Versions: 1

Compression:

Stored size: 516 Bytes

Contents

class ThreadStackExtractor

	def initialize(file)
		@file = file
	end

	def getThreadStacks
		stacks = Array.new()

		stack = Array.new()
		while (line = @file.gets)
      encoded = line.encode('UTF-8', 'UTF-8', { :invalid => :replace })
			case encoded
				when /^3XMTHREADINFO\s*(.*)/ then
					stacks << stack unless stack.empty?
					stack = Array.new()	
				when /^4XESTACKTRACE\s*(.*)/ then
					stack << $1
			end
		end
		stacks << stack unless stack.empty?

		return stacks
	end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
WasThreadStackProcessor-0.1.5 lib/threadStackExtractor.rb