Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions src/Nest/DSL/ClusterStatsDescriptor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using Elasticsearch.Net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Nest
{
internal static class ClusterStatsPathInfo
{
public static void Update(ElasticsearchPathInfo<ClusterStatsRequestParameters> pathInfo)
{
pathInfo.HttpMethod = PathInfoHttpMethod.GET;
}
}

public interface IClusterStatsRequest : IRequest<ClusterStatsRequestParameters>
{
}

public partial class ClusterStatsRequest : BasePathRequest<ClusterStatsRequestParameters>, IClusterStatsRequest
{
protected override void UpdatePathInfo(IConnectionSettingsValues settings, ElasticsearchPathInfo<ClusterStatsRequestParameters> pathInfo)
{
ClusterStatsPathInfo.Update(pathInfo);
}
}

public partial class ClusterStatsDescriptor
: BasePathDescriptor<ClusterStatsDescriptor, ClusterStatsRequestParameters>, IClusterStatsRequest
{
protected override void UpdatePathInfo(IConnectionSettingsValues settings, ElasticsearchPathInfo<ClusterStatsRequestParameters> pathInfo)
{
ClusterStatsPathInfo.Update(pathInfo);
}
}
}
8 changes: 1 addition & 7 deletions src/Nest/DSL/_Descriptors.generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1237,7 +1237,7 @@ public ClusterStateDescriptor FlatSettings(bool flat_settings = true)
///http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cluster-stats.html
///</pre>
///</summary>
public partial class ClusterStatsDescriptor : BaseRequest<ClusterStatsRequestParameters>
public partial class ClusterStatsDescriptor
{


Expand All @@ -1257,12 +1257,6 @@ public ClusterStatsDescriptor Human(bool human = true)
return this;
}


protected override void UpdatePathInfo(IConnectionSettingsValues settings, ElasticsearchPathInfo<ClusterStatsRequestParameters> pathInfo)
{
throw new NotImplementedException();
}


}

Expand Down
8 changes: 1 addition & 7 deletions src/Nest/DSL/_Requests.generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1159,7 +1159,7 @@ public bool FlatSettings
///http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cluster-stats.html
///</pre>
///</summary>
public partial class ClusterStatsRequest : BasePathRequest<ClusterStatsRequestParameters>
public partial class ClusterStatsRequest
{

///<summary>Return settings in flat format (default: false)</summary>
Expand All @@ -1177,12 +1177,6 @@ public bool Human
set { this.Request.RequestParameters.AddQueryString("human", value); }
}


protected override void UpdatePathInfo(IConnectionSettingsValues settings, ElasticsearchPathInfo<ClusterStatsRequestParameters> pathInfo)
{
throw new NotImplementedException();
}

}


Expand Down
31 changes: 31 additions & 0 deletions src/Nest/Domain/Responses/ClusterStatsResponse.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Nest
{
public interface IClusterStatsResponse : IResponse
{
string ClusterName { get; set; }
string Status { get; set; }
IndicesStats Indices { get; set; }
ClusterNodesStats Nodes { get; set; }
}

[JsonObject]
public class ClusterStatsResponse : BaseResponse, IClusterStatsResponse
{
[JsonProperty("cluster_name")]
public string ClusterName { get; set; }
[JsonProperty("status")]
public string Status { get; set; }

[JsonProperty("indices")]
public IndicesStats Indices { get; set; }

[JsonProperty("nodes")]
public ClusterNodesStats Nodes { get; set; }
}
}
217 changes: 217 additions & 0 deletions src/Nest/Domain/Stats/ClusterNodesStas.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,217 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Nest
{
[JsonObject]
public class ClusterNodesStats
{
[JsonProperty("count")]
public ClusterNodeCount Count { get; internal set; }

[JsonProperty("versions")]
public List<string> Versions { get; internal set; }

[JsonProperty("os")]
public ClusterOs Os { get; internal set; }

[JsonProperty("process")]
public ClusterProcess Process { get; internal set; }

[JsonProperty("jvm")]
public ClusterJvm Jvm { get; internal set; }

[JsonProperty("fs")]
public ClusterFileSystem FileSystem { get; internal set; }

[JsonProperty("plugins")]
public List<PluginStats> Plugins { get; internal set; }
}

[JsonObject]
public class ClusterFileSystem
{
[JsonProperty("total")]
public string Total { get; internal set; }
[JsonProperty("total_in_bytes")]
public long TotalInBytes { get; internal set; }
[JsonProperty("free")]
public string Free { get; internal set; }
[JsonProperty("free_in_bytes")]
public long FreeInBytes { get; internal set; }
[JsonProperty("available")]
public string Available { get; internal set; }
[JsonProperty("available_in_bytes")]
public long AvailableInBytes { get; internal set; }
[JsonProperty("disk_reads")]
public long DiskReads { get; internal set; }
[JsonProperty("disk_writes")]
public long DiskWrites { get; internal set; }
[JsonProperty("disk_io_op")]
public long DiskIoOps { get; internal set; }
[JsonProperty("disk_read_size")]
public string DiskReadSize { get; internal set; }
[JsonProperty("disk_read_size_in_bytes")]
public long DiskReadSizeInBytes { get; internal set; }
[JsonProperty("disk_write_size")]
public string DiskWriteSize { get; internal set; }
[JsonProperty("disk_write_size_in_bytes")]
public long DiskWriteSizeInBytes { get; internal set; }
[JsonProperty("disk_queue")]
public string DiskQueue { get; internal set; }
}

[JsonObject]
public class ClusterJvm
{
[JsonProperty("max_uptime")]
public string MaxUptime { get; internal set; }

[JsonProperty("max_uptime_in_milliseconds")]
public string MaxUptimeInMilliseconds { get; internal set; }

[JsonProperty("versions")]
public List<ClusterJvmVersion> Versions { get; internal set; }

[JsonProperty("mem")]
public ClusterJvmMemory Memory { get; internal set; }

[JsonProperty("threads")]
public long Threads { get; internal set; }
}

[JsonObject]
public class ClusterJvmVersion
{
[JsonProperty("version")]
public string Version { get; internal set; }

[JsonProperty("vm_name")]
public string VmName { get; internal set; }

[JsonProperty("vm_version")]
public string VmVersion { get; internal set; }

[JsonProperty("vm_vendor")]
public string VmVendor { get; internal set; }

[JsonProperty("count")]
public int Count { get; internal set; }
}

[JsonObject]
public class ClusterJvmMemory
{
[JsonProperty("heap_used")]
public string HeapUsed { get ;set;}

[JsonProperty("heap_used_in_bytes")]
public long HeapUsedInBytes { get; internal set; }

[JsonProperty("heap_max")]
public string HeapMax { get; internal set; }

[JsonProperty("heap_max_in_bytes")]
public long HeapMaxInBytes { get; internal set; }
}

[JsonObject]
public class ClusterProcess
{
[JsonProperty("cpu")]
public ClusterProcessCpu Cpu { get; internal set; }

[JsonProperty("open_file_descriptors")]
public ClusterProcessOpenFileDescriptors OpenFileDescriptors { get; internal set; }
}

[JsonObject]
public class ClusterProcessCpu
{
[JsonProperty("percent")]
public int Percent { get; internal set; }
}

[JsonObject]
public class ClusterProcessOpenFileDescriptors
{
[JsonProperty("min")]
public long Min { get; internal set; }

[JsonProperty("max")]
public long Max { get; internal set; }

[JsonProperty("avg")]
public long Avg { get; internal set; }
}

[JsonObject]
public class ClusterOs
{
[JsonProperty("available_processors")]
public int AvailableProcessors { get; internal set; }

[JsonProperty("mem")]
public ClusterOsMemory Memory { get; internal set; }

[JsonProperty("cpu")]
public List<ClusterCpu> Cpu { get; internal set; }
}

[JsonObject]
public class ClusterOsMemory
{
[JsonProperty("total_in_bytes")]
public long TotalInBytes { get; internal set; }
}

[JsonObject]
public class ClusterCpu
{
[JsonProperty("vendor")]
public string Vendor { get; internal set; }

[JsonProperty("model")]
public string Model { get; internal set; }

[JsonProperty("mhz")]
public int Mhz { get; internal set; }

[JsonProperty("total_scores")]
public int TotalCores { get; internal set; }

[JsonProperty("total_sockets")]
public int TotalSockets { get; internal set; }

[JsonProperty("cores_per_socket")]
public int CoresPerSocket { get; internal set; }

[JsonProperty("cache_size_in_bytes")]
public int CacheSizeInBytes { get; internal set; }

[JsonProperty("count")]
public int Count { get; internal set; }
}

[JsonObject]
public class ClusterNodeCount
{
[JsonProperty("total")]
public int Total { get; internal set; }

[JsonProperty("master_only")]
public int MasterOnly { get; internal set; }

[JsonProperty("data_only")]
public int DataOnly { get; internal set; }

[JsonProperty("master_data")]
public int MasterData { get; internal set; }

[JsonProperty("client")]
public int Client { get; internal set; }
}
}
18 changes: 18 additions & 0 deletions src/Nest/Domain/Stats/CompletionStats.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Nest
{
[JsonObject]
public class CompletionStats
{
[JsonProperty("size")]
public string Size { get; set; }

[JsonProperty("size_in_bytes")]
public long SizeInBytes { get; set; }
}
}
21 changes: 21 additions & 0 deletions src/Nest/Domain/Stats/FieldDataStats.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Nest
{
[JsonObject]
public class FieldDataStats
{
[JsonProperty("memory_size")]
public string MemorySize { get; set; }

[JsonProperty("memory_size_in_bytes")]
public long MemorySizeInBytes { get; set; }

[JsonProperty("evictions")]
public long Evictions { get; set; }
}
}
21 changes: 21 additions & 0 deletions src/Nest/Domain/Stats/FilterCacheStats.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Nest
{
[JsonObject]
public class FilterCacheStats
{
[JsonProperty("memory_size")]
public string MemorySize { get; set; }

[JsonProperty("memory_size_in_bytes")]
public long MemorySizeInBytes { get; set; }

[JsonProperty("evictions")]
public long Evictions { get; set; }
}
}
Loading