Hello, I''m working in an environment that''s very Ruby heavy and I''ve never used ruby before. I need to be able to access Windows performance counters in from a Windows service is written in native Ruby (not IronRuby). I''m traditionally a C# and JAVA programmer. I was wondering if it might be possible for Ruby to be able to access the .Net System.Diagnostics performance counters via IronRuby. Of course, if there''s a much simpler way I''m all ears. I tried searching the forum and it seems my searching skills are not up to par and apologize if this has been already answered. Thanks in advance for any help. Ameer. -- Posted via http://www.ruby-forum.com/.
You can access System.Diagnostics via IronRuby. However, you will have to use the IronRuby interpreter to run your native ruby code, which is something I guess you are not willing to do (yet). Maybe you''d better look for a gem or a Ruby library that simplifies performance counter access... Thanks, Shay. -------------------------------------------------- Shay Friedman Author of IronRuby Unleashed http://www.IronShay.com Follow me: http://twitter.com/ironshay On Mon, Dec 28, 2009 at 4:58 PM, Ameer Deen <lists at ruby-forum.com> wrote:> Hello, > > I''m working in an environment that''s very Ruby heavy and I''ve never used > ruby before. I need to be able to access Windows performance counters in > from a Windows service is written in native Ruby (not IronRuby). I''m > traditionally a C# and JAVA programmer. > > I was wondering if it might be possible for Ruby to be able to access > the .Net System.Diagnostics performance counters via IronRuby. Of > course, if there''s a much simpler way I''m all ears. > > I tried searching the forum and it seems my searching skills are not up > to par and apologize if this has been already answered. Thanks in > advance for any help. > > > Ameer. > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20091228/aca8b2f4/attachment.html>
To access the .NET framework from MRI (the Ruby implementation you are currently using), your best bet is to use RubyCLR: http://rubyforge.org/projects/rubyclr/. It is a native bridge between Ruby and the CLR, using Ruby''s Win32OLE support to talk directly to the CLR hosting APIs. ~js ________________________________________ From: ironruby-core-bounces at rubyforge.org [ironruby-core-bounces at rubyforge.org] on behalf of Ameer Deen [lists at ruby-forum.com] Sent: Monday, December 28, 2009 6:58 AM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] Using IronRuby from Ruby (newbie) Hello, I''m working in an environment that''s very Ruby heavy and I''ve never used ruby before. I need to be able to access Windows performance counters in from a Windows service is written in native Ruby (not IronRuby). I''m traditionally a C# and JAVA programmer. I was wondering if it might be possible for Ruby to be able to access the .Net System.Diagnostics performance counters via IronRuby. Of course, if there''s a much simpler way I''m all ears. I tried searching the forum and it seems my searching skills are not up to par and apologize if this has been already answered. Thanks in advance for any help. Ameer. -- Posted via http://www.ruby-forum.com/. _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core
Shay Friedman wrote:> You can access System.Diagnostics via IronRuby. However, you will have > to > use the IronRuby interpreter to run your native ruby code, which is > something I guess you are not willing to do (yet). > > Maybe you''d better look for a gem or a Ruby library that simplifies > performance counter access... > > Thanks, > Shay. > > -------------------------------------------------- > Shay Friedman > Author of IronRuby Unleashed > http://www.IronShay.com > Follow me: http://twitter.com/ironshayHi there Shay, I''m not sure if I can run this existing ruby service (called collectd) on IronRuby instead and I need to investigate that so your right about the yet :). I''ll see if I can find a gem that can do what I''m looking for. Thanks for the help. Ameer. -- Posted via http://www.ruby-forum.com/.
Hi there Jimmy, This looks very promising. Thanks very much for the pointer. Ameer. Jimmy Schementi wrote:> To access the .NET framework from MRI (the Ruby implementation you are > currently using), your best bet is to use RubyCLR: > http://rubyforge.org/projects/rubyclr/. It is a native bridge between > Ruby and the CLR, using Ruby''s Win32OLE support to talk directly to the > CLR hosting APIs. > > ~js-- Posted via http://www.ruby-forum.com/.
To high speed access the .NET framework from Ruby you can write own Ruby extension on C++/CLI. So you can create custom wrapper for .NET class and optimize them for your needs.
Yeah, RubyCLR is that. On Dec 30, 2009, at 2:41 AM, "????" <Idgy at yandex.ru> wrote:> To high speed access the .NET framework from Ruby you can write own > Ruby extension on C++/CLI. So you can create custom wrapper for .NET > class and optimize them for your needs. > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core >
Hi there Shay, Using IronRuby to run the ruby code turned out to be easier than I thought. I''m able to run the code on IronRuby and access the System.Diagnostics namespace. Thanks very much for your help. Ameer. Shay Friedman wrote:> You can access System.Diagnostics via IronRuby. However, you will have > to > use the IronRuby interpreter to run your native ruby code, which is > something I guess you are not willing to do (yet). > > Maybe you''d better look for a gem or a Ruby library that simplifies > performance counter access... > > Thanks, > Shay. > > -------------------------------------------------- > Shay Friedman > Author of IronRuby Unleashed > http://www.IronShay.com > Follow me: http://twitter.com/ironshay-- Posted via http://www.ruby-forum.com/.